Hi Ray, Sounds like you have noise problems. KFLOP inputs are high impedance and fast. Regarding the "runaway": It is probably noise causing the MPG program to get confused. It is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate. The MPG program loops at about 5KHz. Without the "trick" the count rate is then limited to 5KHz. That would be ~750 RPM for a 100 ppr encoder. The "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec). So it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the
encoder signals tell whether the prediction was correct or off by either +1 or -1 count. This can extend the counting rate to as high as 100KHz. This works exceptionally well in the absence of noise. Noise can generate signal sequences that basically make no physical sense which confuse the algorithm and causes a runaway (It assumes the signals are aliasing at a high speed).
You can disable the "trick" by changing the line:
DiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
to
DiffX2 = 2*(Pos-PosNoWrap);
Noise will then just cause several miss-steps and no runaway. You will then be limited to 5KHz encoder rates.
Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
Please give this a try to see if it stops any runaways.
Regards TK
Group: DynoMotion |
Message: 2109 |
From: himykabibble |
Date: 11/3/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> Sounds like you have noise problems. KFLOP inputs are high impedance and fast.Â
> Â
> Regarding the "runaway": It is probably noise causing the MPG program to get confused. It is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate. The MPG program loops at about 5KHz. Without the "trick" the count rate is then limited to 5KHz. That would be ~750 RPM for a 100 ppr encoder.  The "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec). So it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the encoder signals tell whether the prediction was correct or off by either +1 or -1 count. This can extend the counting rate to as high as 100KHz.  This works exceptionally well in the absence of noise. Noise can generate signal sequences that basically make no physical sense which confuse the algorithm and causes a runaway
> (It assumes the signals are aliasing at a high speed).
> Â
>
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 3, 2011 4:34 PM
> Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
>
>
> Â
> I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
>
> Where to look?
>
> I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
>
> Regards,
> Ray L.
>
>
>
>
>
> You can disable the "trick" by changing the line:
> Â
> Â DiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> to
> Â DiffX2 = 2*(Pos-PosNoWrap);
> Â
> Noise will then just cause several miss-steps and no runaway. You will then be limited to 5KHz encoder rates.
> Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> Â
> Please give this a try to see if it stops any runaways.
> Â
> Regards
> TK
>
|
|
Group: DynoMotion |
Message: 2110 |
From: Tom Kerekes |
Date: 11/3/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
Yes you have a point. But I think one of the main purposes of KFLOP (or any external controller) is to relieve Mach3/Windows/PC of any real time response. KFLOP is intentionally designed to continue any motion smoothly even though Mach3, Windows, or USB communication freezes for several seconds. So any watchdog or such coming from Mach3 would need to be set for more than several seconds which would probably be too late. Actually in the runaway situation it wouldn't have helped anyway because communication was still happening.
Any safety or watchdog or estop really needs to be handled in KFLOP or implemented in hardware. And KFLOP may not be configured properly so it can't be counted on 100% for safety. The only way to do that is with hard wiring.
Regards
TK
Group: DynoMotion |
Message: 2111 |
From: Tom Kerekes |
Date: 11/3/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
Only the programs that have been told to execute will be running. I assumed you created and configured an Init.c program with the MPG code. That is a reqirement before you even try to run Mach3. Often a loop is placed at the end of the Init.c program to run forever after everything is initialized. The loop can do things like service the MPG and also perform watchdog type tasks.
Maybe you could post the Init.c file you are configured to use.
Regards
TK
Group: DynoMotion |
Message: 2112 |
From: himykabibble |
Date: 11/3/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
#include "KMotionDef.h"
#include "MyCommonDefs.h"
main()
{
ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=70000;
ch0->Accel=500000;
ch0->Jerk=4e+006;
ch0->P=0;
ch0->I=0.01;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=1e+006;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=0;
ch0->InputChan1=0;
ch0->OutputChan0=8;
ch0->OutputChan1=0;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=20;
ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;
ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;
ch0->iir[2].B0=0.000769;
ch0->iir[2].B1=0.001538;
ch0->iir[2].B2=0.000769;
ch0->iir[2].A1=1.92081;
ch0->iir[2].A2=-0.923885;
EnableAxisDest(0,0);
ch1->InputMode=NO_INPUT_MODE;
ch1->OutputMode=STEP_DIR_MODE;
ch1->Vel=70000;
ch1->Accel=500000;
ch1->Jerk=4e+006;
ch1->P=0;
ch1->I=0.01;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=200;
ch1->MaxErr=1e+006;
ch1->MaxOutput=200;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=1;
ch1->InputChan1=0;
ch1->OutputChan0=9;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x0;
ch1->InputGain0=1;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=1000000000;
ch1->StepperAmplitude=20;
ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;
ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;
ch1->iir[2].B0=0.000769;
ch1->iir[2].B1=0.001538;
ch1->iir[2].B2=0.000769;
ch1->iir[2].A1=1.92081;
ch1->iir[2].A2=-0.923885;
EnableAxisDest(1,0);
ch2->InputMode=NO_INPUT_MODE;
ch2->OutputMode=STEP_DIR_MODE;
ch2->Vel=51000;
ch2->Accel=700000;
ch2->Jerk=4e+006;
ch2->P=0;
ch2->I=0.01;
ch2->D=0;
ch2->FFAccel=0;
ch2->FFVel=0;
ch2->MaxI=200;
ch2->MaxErr=1e+006;
ch2->MaxOutput=200;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=2;
ch2->InputChan1=0;
ch2->OutputChan0=10;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x0;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=1000000000;
ch2->StepperAmplitude=20;
ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;
ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;
ch2->iir[2].B0=0.000769;
ch2->iir[2].B1=0.001538;
ch2->iir[2].B2=0.000769;
ch2->iir[2].A1=1.92081;
ch2->iir[2].A2=-0.923885;
EnableAxisDest(2,0);
ch3->InputMode=NO_INPUT_MODE;
ch3->OutputMode=STEP_DIR_MODE;
ch3->Vel=80000;
ch3->Accel=40000;
ch3->Jerk=400000;
ch3->P=1;
ch3->I=0;
ch3->D=0;
ch3->FFAccel=0;
ch3->FFVel=0;
ch3->MaxI=200;
ch3->MaxErr=1e+006;
ch3->MaxOutput=200;
ch3->DeadBandGain=1;
ch3->DeadBandRange=0;
ch3->InputChan0=3;
ch3->InputChan1=3;
ch3->OutputChan0=11;
ch3->OutputChan1=7;
ch3->MasterAxis=-1;
ch3->LimitSwitchOptions=0x0;
ch3->InputGain0=1;
ch3->InputGain1=1;
ch3->InputOffset0=0;
ch3->InputOffset1=0;
ch3->OutputGain=1;
ch3->OutputOffset=0;
ch3->SlaveGain=1;
ch3->BacklashMode=BACKLASH_OFF;
ch3->BacklashAmount=0;
ch3->BacklashRate=0;
ch3->invDistPerCycle=1;
ch3->Lead=0;
ch3->MaxFollowingError=1000000000;
ch3->StepperAmplitude=20;
ch3->iir[0].B0=1;
ch3->iir[0].B1=0;
ch3->iir[0].B2=0;
ch3->iir[0].A1=0;
ch3->iir[0].A2=0;
ch3->iir[1].B0=1;
ch3->iir[1].B1=0;
ch3->iir[1].B2=0;
ch3->iir[1].A1=0;
ch3->iir[1].A2=0;
ch3->iir[2].B0=1;
ch3->iir[2].B1=0;
ch3->iir[2].B2=0;
ch3->iir[2].A1=0;
ch3->iir[2].A2=0;
EnableAxisDest(3,0);
DefineCoordSystem(0,1,2,3);
// Configure Enable bit as output, and clear it
SetBitDirection(ENABLE, 1);
//ClearBit(ENABLE);
// Configure Spindle Control pins as outputs, and clear them
SetBitDirection(SPINDLE_CW, 1);
ClearBit(SPINDLE_CW);
SetBitDirection(SPINDLE_CCW, 1);
ClearBit(SPINDLE_CCW);
// Zero the spindle PWM output
FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
FPGA(IO_PWMS) = (unsigned char)(0); // set period
FPGA(IO_PWMS+1) = 1; // Enable
// Configure Coolant Control pins as outputs, and clear them
SetBitDirection(COOLANT_MIST, 1);
ClearBit(COOLANT_MIST);
SetBitDirection(COOLANT_FLOOD, 1);
ClearBit(COOLANT_FLOOD);
// Configure Probe pin as input
SetBitDirection(PROBE, 0);
// Configire E-Stop pin as input
SetBitDirection(ESTOP, 0);
// Configure Home/Limit pin as input
SetBitDirection(HOME_LIMIT, 0);
}
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> Only the programs that have been told to execute will be running.  I assumed you created and configured an Init.c program with the MPG code. That is a reqirement before you even try to run Mach3. Often a loop is placed at the end of the Init.c program to run forever after everything is initialized. The loop can do things like service the MPG and also perform watchdog type tasks.
> Â
> Maybe you could post the Init.c file you are configured to use.
> Â
> Regards
> TK
> Â
> Â Â
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 3, 2011 5:54 PM
> Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Â
> Tom,
>
> I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
>
> Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > ÃÂ
> > Sounds like you have noise problems.ÃÂ KFLOP inputs are high impedance and fast.ÃÂ
> > ÃÂ
> > Regarding the "runaway":ÃÂ It is probably noise causing the MPG program to get confused.ÃÂ It is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÂ The MPG program loops at about 5KHz.ÃÂ Without the "trick" the count rate is then limited to 5KHz.ÃÂ That would be ~750 RPM for a 100 ppr encoder.ÃÂ ÃÂ The "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÂ So it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÂ This can extend the counting rate to as high as 100KHz.ÃÂ ÃÂ This works exceptionally well in the absence of noise.ÃÂ Noise can generate signal sequences that basically make no physical sense which confuse the
> algorithm and causes a runaway
> > (It assumes the signals are aliasing at a high speed).
> > ÃÂ
> >
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 3, 2011 4:34 PM
> > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> >
> >
> > ÃÂ
> > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> >
> > Where to look?
> >
> > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> >
> > Regards,
> > Ray L.
> >
> >
> >
> >
> >
> > You can disable the "trick" by changing the line:
> > ÃÂ
> > ÃÂ DiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > to
> > ÃÂ DiffX2 = 2*(Pos-PosNoWrap);
> > ÃÂ
> > Noise will then just cause several miss-steps and no runaway.ÃÂ You will then be limited to 5KHz encoder rates.
> > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > ÃÂ
> > Please give this a try to see if it stops any runaways.
> > ÃÂ
> > Regards
> > TK
> >
>
|
|
Group: DynoMotion |
Message: 2113 |
From: Tom Kerekes |
Date: 11/3/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
You are correct there isn't any loop. I headed off in the totally wrong direction.
I don't know what it could be. How were you jogging then anyway? With the keyboard? Didn't you say you had a modbus MPG? PoKeys? Do you have any external events defined in Mach3?
Regards
TK
Group: DynoMotion |
Message: 2114 |
From: himykabibble |
Date: 11/3/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> You are correct there isn't any loop. I headed off in the totally wrong direction.
> Â
> I don't know what it could be. How were you jogging then anyway? With the keyboard? Didn't you say you had a modbus MPG? PoKeys? Do you have any external events defined in Mach3?
> Â
> Regards
> TK
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 3, 2011 6:58 PM
> Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Â
> Tom,
>
> No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
>
> #include "KMotionDef.h"
> #include "MyCommonDefs.h"
>
> main()
> {
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=70000;
> ch0->Accel=500000;
> ch0->Jerk=4e+006;
> ch0->P=0;
> ch0->I=0.01;
> ch0->D=0;
> ch0->FFAccel=0;
> ch0->FFVel=0;
> ch0->MaxI=200;
> ch0->MaxErr=1e+006;
> ch0->MaxOutput=200;
> ch0->DeadBandGain=1;
> ch0->DeadBandRange=0;
> ch0->InputChan0=0;
> ch0->InputChan1=0;
> ch0->OutputChan0=8;
> ch0->OutputChan1=0;
> ch0->MasterAxis=-1;
> ch0->LimitSwitchOptions=0x0;
> ch0->InputGain0=1;
> ch0->InputGain1=1;
> ch0->InputOffset0=0;
> ch0->InputOffset1=0;
> ch0->OutputGain=1;
> ch0->OutputOffset=0;
> ch0->SlaveGain=1;
> ch0->BacklashMode=BACKLASH_OFF;
> ch0->BacklashAmount=0;
> ch0->BacklashRate=0;
> ch0->invDistPerCycle=1;
> ch0->Lead=0;
> ch0->MaxFollowingError=1000000000;
> ch0->StepperAmplitude=20;
>
> ch0->iir[0].B0=1;
> ch0->iir[0].B1=0;
> ch0->iir[0].B2=0;
> ch0->iir[0].A1=0;
> ch0->iir[0].A2=0;
>
> ch0->iir[1].B0=1;
> ch0->iir[1].B1=0;
> ch0->iir[1].B2=0;
> ch0->iir[1].A1=0;
> ch0->iir[1].A2=0;
>
> ch0->iir[2].B0=0.000769;
> ch0->iir[2].B1=0.001538;
> ch0->iir[2].B2=0.000769;
> ch0->iir[2].A1=1.92081;
> ch0->iir[2].A2=-0.923885;
>
> EnableAxisDest(0,0);
>
> ch1->InputMode=NO_INPUT_MODE;
> ch1->OutputMode=STEP_DIR_MODE;
> ch1->Vel=70000;
> ch1->Accel=500000;
> ch1->Jerk=4e+006;
> ch1->P=0;
> ch1->I=0.01;
> ch1->D=0;
> ch1->FFAccel=0;
> ch1->FFVel=0;
> ch1->MaxI=200;
> ch1->MaxErr=1e+006;
> ch1->MaxOutput=200;
> ch1->DeadBandGain=1;
> ch1->DeadBandRange=0;
> ch1->InputChan0=1;
> ch1->InputChan1=0;
> ch1->OutputChan0=9;
> ch1->OutputChan1=0;
> ch1->MasterAxis=-1;
> ch1->LimitSwitchOptions=0x0;
> ch1->InputGain0=1;
> ch1->InputGain1=1;
> ch1->InputOffset0=0;
> ch1->InputOffset1=0;
> ch1->OutputGain=1;
> ch1->OutputOffset=0;
> ch1->SlaveGain=1;
> ch1->BacklashMode=BACKLASH_OFF;
> ch1->BacklashAmount=0;
> ch1->BacklashRate=0;
> ch1->invDistPerCycle=1;
> ch1->Lead=0;
> ch1->MaxFollowingError=1000000000;
> ch1->StepperAmplitude=20;
>
> ch1->iir[0].B0=1;
> ch1->iir[0].B1=0;
> ch1->iir[0].B2=0;
> ch1->iir[0].A1=0;
> ch1->iir[0].A2=0;
>
> ch1->iir[1].B0=1;
> ch1->iir[1].B1=0;
> ch1->iir[1].B2=0;
> ch1->iir[1].A1=0;
> ch1->iir[1].A2=0;
>
> ch1->iir[2].B0=0.000769;
> ch1->iir[2].B1=0.001538;
> ch1->iir[2].B2=0.000769;
> ch1->iir[2].A1=1.92081;
> ch1->iir[2].A2=-0.923885;
>
> EnableAxisDest(1,0);
>
> ch2->InputMode=NO_INPUT_MODE;
> ch2->OutputMode=STEP_DIR_MODE;
> ch2->Vel=51000;
> ch2->Accel=700000;
> ch2->Jerk=4e+006;
> ch2->P=0;
> ch2->I=0.01;
> ch2->D=0;
> ch2->FFAccel=0;
> ch2->FFVel=0;
> ch2->MaxI=200;
> ch2->MaxErr=1e+006;
> ch2->MaxOutput=200;
> ch2->DeadBandGain=1;
> ch2->DeadBandRange=0;
> ch2->InputChan0=2;
> ch2->InputChan1=0;
> ch2->OutputChan0=10;
> ch2->OutputChan1=0;
> ch2->MasterAxis=-1;
> ch2->LimitSwitchOptions=0x0;
> ch2->InputGain0=1;
> ch2->InputGain1=1;
> ch2->InputOffset0=0;
> ch2->InputOffset1=0;
> ch2->OutputGain=1;
> ch2->OutputOffset=0;
> ch2->SlaveGain=1;
> ch2->BacklashMode=BACKLASH_OFF;
> ch2->BacklashAmount=0;
> ch2->BacklashRate=0;
> ch2->invDistPerCycle=1;
> ch2->Lead=0;
> ch2->MaxFollowingError=1000000000;
> ch2->StepperAmplitude=20;
>
> ch2->iir[0].B0=1;
> ch2->iir[0].B1=0;
> ch2->iir[0].B2=0;
> ch2->iir[0].A1=0;
> ch2->iir[0].A2=0;
>
> ch2->iir[1].B0=1;
> ch2->iir[1].B1=0;
> ch2->iir[1].B2=0;
> ch2->iir[1].A1=0;
> ch2->iir[1].A2=0;
>
> ch2->iir[2].B0=0.000769;
> ch2->iir[2].B1=0.001538;
> ch2->iir[2].B2=0.000769;
> ch2->iir[2].A1=1.92081;
> ch2->iir[2].A2=-0.923885;
>
> EnableAxisDest(2,0);
>
> ch3->InputMode=NO_INPUT_MODE;
> ch3->OutputMode=STEP_DIR_MODE;
> ch3->Vel=80000;
> ch3->Accel=40000;
> ch3->Jerk=400000;
> ch3->P=1;
> ch3->I=0;
> ch3->D=0;
> ch3->FFAccel=0;
> ch3->FFVel=0;
> ch3->MaxI=200;
> ch3->MaxErr=1e+006;
> ch3->MaxOutput=200;
> ch3->DeadBandGain=1;
> ch3->DeadBandRange=0;
> ch3->InputChan0=3;
> ch3->InputChan1=3;
> ch3->OutputChan0=11;
> ch3->OutputChan1=7;
> ch3->MasterAxis=-1;
> ch3->LimitSwitchOptions=0x0;
> ch3->InputGain0=1;
> ch3->InputGain1=1;
> ch3->InputOffset0=0;
> ch3->InputOffset1=0;
> ch3->OutputGain=1;
> ch3->OutputOffset=0;
> ch3->SlaveGain=1;
> ch3->BacklashMode=BACKLASH_OFF;
> ch3->BacklashAmount=0;
> ch3->BacklashRate=0;
> ch3->invDistPerCycle=1;
> ch3->Lead=0;
> ch3->MaxFollowingError=1000000000;
> ch3->StepperAmplitude=20;
>
> ch3->iir[0].B0=1;
> ch3->iir[0].B1=0;
> ch3->iir[0].B2=0;
> ch3->iir[0].A1=0;
> ch3->iir[0].A2=0;
>
> ch3->iir[1].B0=1;
> ch3->iir[1].B1=0;
> ch3->iir[1].B2=0;
> ch3->iir[1].A1=0;
> ch3->iir[1].A2=0;
>
> ch3->iir[2].B0=1;
> ch3->iir[2].B1=0;
> ch3->iir[2].B2=0;
> ch3->iir[2].A1=0;
> ch3->iir[2].A2=0;
>
> EnableAxisDest(3,0);
>
> DefineCoordSystem(0,1,2,3);
>
> // Configure Enable bit as output, and clear it
> SetBitDirection(ENABLE, 1);
> //ClearBit(ENABLE);
>
> // Configure Spindle Control pins as outputs, and clear them
> SetBitDirection(SPINDLE_CW, 1);
> ClearBit(SPINDLE_CW);
> SetBitDirection(SPINDLE_CCW, 1);
> ClearBit(SPINDLE_CCW);
> // Zero the spindle PWM output
> FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> FPGA(IO_PWMS) = (unsigned char)(0); // set period
> FPGA(IO_PWMS+1) = 1; // Enable
>
> // Configure Coolant Control pins as outputs, and clear them
> SetBitDirection(COOLANT_MIST, 1);
> ClearBit(COOLANT_MIST);
> SetBitDirection(COOLANT_FLOOD, 1);
> ClearBit(COOLANT_FLOOD);
>
> // Configure Probe pin as input
> SetBitDirection(PROBE, 0);
>
> // Configire E-Stop pin as input
> SetBitDirection(ESTOP, 0);
>
> // Configure Home/Limit pin as input
> SetBitDirection(HOME_LIMIT, 0);
>
> }
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > ÃÂ
> > Only the programs that have been told to execute will be running.ÃÂ ÃÂ I assumed you created and configured an Init.c program with the MPG code.ÃÂ That is a reqirement before you even try to run Mach3.ÃÂ Often a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃÂ The loop can do things like service the MPG and also perform watchdog type tasks.
> > ÃÂ
> > Maybe you could postÃÂ the Init.c file you areÃÂ configured to use.
> > ÃÂ
> > Regards
> > TK
> > ÃÂ
> > ÃÂ ÃÂ
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 3, 2011 5:54 PM
> > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> >
> >
> > ÃÂ
> > Tom,
> >
> > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> >
> > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃâÃÂ
> > > Sounds like you have noise problems.ÃâàKFLOP inputs are high impedance and fast.ÃâÃÂ
> > > ÃâÃÂ
> > > Regarding the "runaway":ÃâàIt is probably noise causing the MPG program to get confused.ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃâàThe MPG program loops at about 5KHz.ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃâàÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃâàThis can extend the counting rate to as high as 100KHz.ÃâàÃâàThis works exceptionally well in the absence of noise.ÃâàNoise can generate signal sequences
> that basically make no physical sense which confuse the
> > algorithm and causes a runaway
> > > (It assumes the signals are aliasing at a high speed).
> > > ÃâÃÂ
> > >
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, November 3, 2011 4:34 PM
> > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > >
> > >
> > > ÃâÃÂ
> > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > >
> > > Where to look?
> > >
> > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > >
> > > Regards,
> > > Ray L.
> > >
> > >
> > >
> > >
> > >
> > > You can disable the "trick" by changing the line:
> > > ÃâÃÂ
> > > ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > to
> > > ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > ÃâÃÂ
> > > Noise will then just cause several miss-steps and no runaway.ÃâàYou will then be limited to 5KHz encoder rates.
> > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > ÃâÃÂ
> > > Please give this a try to see if it stops any runaways.
> > > ÃâÃÂ
> > > Regards
> > > TK
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2115 |
From: Allen |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
Do you have an Enable output configured through Mach? I know as long as I have an Enable output setup up for my servo drives I can reset the software or close it and the drives will disable.
I know this is not much of a suggestion and you have probably already done this but thought I would throw it out there :)
Allen
--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
>
> Where to look?
>
> I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
>
> Regards,
> Ray L.
>
|
|
Group: DynoMotion |
Message: 2116 |
From: Tom Kerekes |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
That is strange. The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
Can you give more clues like how often it happens, whether it does it when jogging cont. or steps? How is the runaway motion constant speed? Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
Thanks
TK
Group: DynoMotion |
Message: 2117 |
From: Ross Ferguson |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
I would agree that the behavior you mention is alarming.
What I find extraordinarily alarming is that your E-Stop doesn't stop it.
It should cut all power to all drives and disable all axes.
That is assuming that your E-Stop is a big red button and not just the Reset in Mach3.
Ross
On 4/11/2011 12:59 PM, himykabibble wrote:
>
> Ya know, I find this behavior quite alarming, from a safety standpoint. Clearly, the KFlop is
> setting up a pulse generator on the axis, and just letting it free-run, which is a really bad
> thing to do. Loss of communication from the host (Mach3 in this case) should, in a short period of
> time, automatically stop all motion, through a watchdog if necessary.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>, "himykabibble"
> <jagboy@...> wrote:
> >
> > I have only the four axes connected to my machine at present, and it seems to work fine,
> except.... fairly often, when I jog, the axis will just take off and keep right on going until I
> pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with
> Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> >
> > Where to look?
> >
> > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no
> problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This
> is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really
> concern me too much at the moment, however.
> >
> > Regards,
> > Ray L.
> >
>
>
--
Ferguson Windmills Company
835 Old North Road,
R.D.2, Waimauku,
New Zealand. 0882
Ph 64 9 411 8332 Mobile 027 282 7689
Fax 64 9 412 8655
E-mail - ferman@...
http://www.windmills.co.nz
|
|
Group: DynoMotion |
Message: 2118 |
From: himykabibble |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Allen,
Yes, I do, and it normally works fine, but when the runaway occurs, E-stopping Mach3 has no effect - the axis just keeps on going, even if I close then re-open Mach3. That's why it appears to me the KFlop has stopped talking to Mach3.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, "Allen" <agray@...> wrote:
>
> Hi Ray,
>
> Do you have an Enable output configured through Mach? I know as long as I have an Enable output setup up for my servo drives I can reset the software or close it and the drives will disable.
>
> I know this is not much of a suggestion and you have probably already done this but thought I would throw it out there :)
>
> Allen
>
>
>
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> >
> > Where to look?
> >
> > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> >
> > Regards,
> > Ray L.
> >
>
|
|
Group: DynoMotion |
Message: 2119 |
From: himykabibble |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
I'm just jogging at rapid speed when it happens, and it has happened just playing with the KFlop connected to my laptop, no machine present. It happens *often*, as I've only had the KFlop connected to the machine a few times, and it's happened within no more than a handful of jogs each time. It accelerates normally to rapid speed, but just never stops.
I'll send the files later today.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> That is strange. The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> Â
> Can you give more clues like how often it happens, whether it does it when jogging cont. or steps? How is the runaway motion constant speed? Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> Â
> If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> Â
> Thanks
> TK
> Â
> Â
> Â
>
>
> ________________________________
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 3, 2011 7:54 PM
> Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Â
> Tom,
>
> Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > ÃÂ
> > You are correct there isn't any loop.ÃÂ I headed off in the totally wrong direction.
> > ÃÂ
> > I don't know what it could be.ÃÂ How were you jogging then anyway?ÃÂ With the keyboard?ÃÂ Didn't you say you had a modbus MPG?ÃÂ PoKeys?ÃÂ Do you have any external events defined in Mach3?
> > ÃÂ
> > Regards
> > TK
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 3, 2011 6:58 PM
> > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> >
> >
> > ÃÂ
> > Tom,
> >
> > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> >
> > #include "KMotionDef.h"
> > #include "MyCommonDefs.h"
> >
> > main()
> > {
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=70000;
> > ch0->Accel=500000;
> > ch0->Jerk=4e+006;
> > ch0->P=0;
> > ch0->I=0.01;
> > ch0->D=0;
> > ch0->FFAccel=0;
> > ch0->FFVel=0;
> > ch0->MaxI=200;
> > ch0->MaxErr=1e+006;
> > ch0->MaxOutput=200;
> > ch0->DeadBandGain=1;
> > ch0->DeadBandRange=0;
> > ch0->InputChan0=0;
> > ch0->InputChan1=0;
> > ch0->OutputChan0=8;
> > ch0->OutputChan1=0;
> > ch0->MasterAxis=-1;
> > ch0->LimitSwitchOptions=0x0;
> > ch0->InputGain0=1;
> > ch0->InputGain1=1;
> > ch0->InputOffset0=0;
> > ch0->InputOffset1=0;
> > ch0->OutputGain=1;
> > ch0->OutputOffset=0;
> > ch0->SlaveGain=1;
> > ch0->BacklashMode=BACKLASH_OFF;
> > ch0->BacklashAmount=0;
> > ch0->BacklashRate=0;
> > ch0->invDistPerCycle=1;
> > ch0->Lead=0;
> > ch0->MaxFollowingError=1000000000;
> > ch0->StepperAmplitude=20;
> >
> > ch0->iir[0].B0=1;
> > ch0->iir[0].B1=0;
> > ch0->iir[0].B2=0;
> > ch0->iir[0].A1=0;
> > ch0->iir[0].A2=0;
> >
> > ch0->iir[1].B0=1;
> > ch0->iir[1].B1=0;
> > ch0->iir[1].B2=0;
> > ch0->iir[1].A1=0;
> > ch0->iir[1].A2=0;
> >
> > ch0->iir[2].B0=0.000769;
> > ch0->iir[2].B1=0.001538;
> > ch0->iir[2].B2=0.000769;
> > ch0->iir[2].A1=1.92081;
> > ch0->iir[2].A2=-0.923885;
> >
> > EnableAxisDest(0,0);
> >
> > ch1->InputMode=NO_INPUT_MODE;
> > ch1->OutputMode=STEP_DIR_MODE;
> > ch1->Vel=70000;
> > ch1->Accel=500000;
> > ch1->Jerk=4e+006;
> > ch1->P=0;
> > ch1->I=0.01;
> > ch1->D=0;
> > ch1->FFAccel=0;
> > ch1->FFVel=0;
> > ch1->MaxI=200;
> > ch1->MaxErr=1e+006;
> > ch1->MaxOutput=200;
> > ch1->DeadBandGain=1;
> > ch1->DeadBandRange=0;
> > ch1->InputChan0=1;
> > ch1->InputChan1=0;
> > ch1->OutputChan0=9;
> > ch1->OutputChan1=0;
> > ch1->MasterAxis=-1;
> > ch1->LimitSwitchOptions=0x0;
> > ch1->InputGain0=1;
> > ch1->InputGain1=1;
> > ch1->InputOffset0=0;
> > ch1->InputOffset1=0;
> > ch1->OutputGain=1;
> > ch1->OutputOffset=0;
> > ch1->SlaveGain=1;
> > ch1->BacklashMode=BACKLASH_OFF;
> > ch1->BacklashAmount=0;
> > ch1->BacklashRate=0;
> > ch1->invDistPerCycle=1;
> > ch1->Lead=0;
> > ch1->MaxFollowingError=1000000000;
> > ch1->StepperAmplitude=20;
> >
> > ch1->iir[0].B0=1;
> > ch1->iir[0].B1=0;
> > ch1->iir[0].B2=0;
> > ch1->iir[0].A1=0;
> > ch1->iir[0].A2=0;
> >
> > ch1->iir[1].B0=1;
> > ch1->iir[1].B1=0;
> > ch1->iir[1].B2=0;
> > ch1->iir[1].A1=0;
> > ch1->iir[1].A2=0;
> >
> > ch1->iir[2].B0=0.000769;
> > ch1->iir[2].B1=0.001538;
> > ch1->iir[2].B2=0.000769;
> > ch1->iir[2].A1=1.92081;
> > ch1->iir[2].A2=-0.923885;
> >
> > EnableAxisDest(1,0);
> >
> > ch2->InputMode=NO_INPUT_MODE;
> > ch2->OutputMode=STEP_DIR_MODE;
> > ch2->Vel=51000;
> > ch2->Accel=700000;
> > ch2->Jerk=4e+006;
> > ch2->P=0;
> > ch2->I=0.01;
> > ch2->D=0;
> > ch2->FFAccel=0;
> > ch2->FFVel=0;
> > ch2->MaxI=200;
> > ch2->MaxErr=1e+006;
> > ch2->MaxOutput=200;
> > ch2->DeadBandGain=1;
> > ch2->DeadBandRange=0;
> > ch2->InputChan0=2;
> > ch2->InputChan1=0;
> > ch2->OutputChan0=10;
> > ch2->OutputChan1=0;
> > ch2->MasterAxis=-1;
> > ch2->LimitSwitchOptions=0x0;
> > ch2->InputGain0=1;
> > ch2->InputGain1=1;
> > ch2->InputOffset0=0;
> > ch2->InputOffset1=0;
> > ch2->OutputGain=1;
> > ch2->OutputOffset=0;
> > ch2->SlaveGain=1;
> > ch2->BacklashMode=BACKLASH_OFF;
> > ch2->BacklashAmount=0;
> > ch2->BacklashRate=0;
> > ch2->invDistPerCycle=1;
> > ch2->Lead=0;
> > ch2->MaxFollowingError=1000000000;
> > ch2->StepperAmplitude=20;
> >
> > ch2->iir[0].B0=1;
> > ch2->iir[0].B1=0;
> > ch2->iir[0].B2=0;
> > ch2->iir[0].A1=0;
> > ch2->iir[0].A2=0;
> >
> > ch2->iir[1].B0=1;
> > ch2->iir[1].B1=0;
> > ch2->iir[1].B2=0;
> > ch2->iir[1].A1=0;
> > ch2->iir[1].A2=0;
> >
> > ch2->iir[2].B0=0.000769;
> > ch2->iir[2].B1=0.001538;
> > ch2->iir[2].B2=0.000769;
> > ch2->iir[2].A1=1.92081;
> > ch2->iir[2].A2=-0.923885;
> >
> > EnableAxisDest(2,0);
> >
> > ch3->InputMode=NO_INPUT_MODE;
> > ch3->OutputMode=STEP_DIR_MODE;
> > ch3->Vel=80000;
> > ch3->Accel=40000;
> > ch3->Jerk=400000;
> > ch3->P=1;
> > ch3->I=0;
> > ch3->D=0;
> > ch3->FFAccel=0;
> > ch3->FFVel=0;
> > ch3->MaxI=200;
> > ch3->MaxErr=1e+006;
> > ch3->MaxOutput=200;
> > ch3->DeadBandGain=1;
> > ch3->DeadBandRange=0;
> > ch3->InputChan0=3;
> > ch3->InputChan1=3;
> > ch3->OutputChan0=11;
> > ch3->OutputChan1=7;
> > ch3->MasterAxis=-1;
> > ch3->LimitSwitchOptions=0x0;
> > ch3->InputGain0=1;
> > ch3->InputGain1=1;
> > ch3->InputOffset0=0;
> > ch3->InputOffset1=0;
> > ch3->OutputGain=1;
> > ch3->OutputOffset=0;
> > ch3->SlaveGain=1;
> > ch3->BacklashMode=BACKLASH_OFF;
> > ch3->BacklashAmount=0;
> > ch3->BacklashRate=0;
> > ch3->invDistPerCycle=1;
> > ch3->Lead=0;
> > ch3->MaxFollowingError=1000000000;
> > ch3->StepperAmplitude=20;
> >
> > ch3->iir[0].B0=1;
> > ch3->iir[0].B1=0;
> > ch3->iir[0].B2=0;
> > ch3->iir[0].A1=0;
> > ch3->iir[0].A2=0;
> >
> > ch3->iir[1].B0=1;
> > ch3->iir[1].B1=0;
> > ch3->iir[1].B2=0;
> > ch3->iir[1].A1=0;
> > ch3->iir[1].A2=0;
> >
> > ch3->iir[2].B0=1;
> > ch3->iir[2].B1=0;
> > ch3->iir[2].B2=0;
> > ch3->iir[2].A1=0;
> > ch3->iir[2].A2=0;
> >
> > EnableAxisDest(3,0);
> >
> > DefineCoordSystem(0,1,2,3);
> >
> > // Configure Enable bit as output, and clear it
> > SetBitDirection(ENABLE, 1);
> > //ClearBit(ENABLE);
> >
> > // Configure Spindle Control pins as outputs, and clear them
> > SetBitDirection(SPINDLE_CW, 1);
> > ClearBit(SPINDLE_CW);
> > SetBitDirection(SPINDLE_CCW, 1);
> > ClearBit(SPINDLE_CCW);
> > // Zero the spindle PWM output
> > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > FPGA(IO_PWMS+1) = 1; // Enable
> >
> > // Configure Coolant Control pins as outputs, and clear them
> > SetBitDirection(COOLANT_MIST, 1);
> > ClearBit(COOLANT_MIST);
> > SetBitDirection(COOLANT_FLOOD, 1);
> > ClearBit(COOLANT_FLOOD);
> >
> > // Configure Probe pin as input
> > SetBitDirection(PROBE, 0);
> >
> > // Configire E-Stop pin as input
> > SetBitDirection(ESTOP, 0);
> >
> > // Configure Home/Limit pin as input
> > SetBitDirection(HOME_LIMIT, 0);
> >
> > }
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃâÃÂ
> > > Only the programs that have been told to execute will be running.ÃâàÃâàI assumed you created and configured an Init.c program with the MPG code.ÃâàThat is a reqirement before you even try to run Mach3.ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > ÃâÃÂ
> > > Maybe you could postÃâàthe Init.c file you areÃâàconfigured to use.
> > > ÃâÃÂ
> > > Regards
> > > TK
> > > ÃâÃÂ
> > > ÃâàÃâÃÂ
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, November 3, 2011 5:54 PM
> > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > >
> > >
> > > ÃâÃÂ
> > > Tom,
> > >
> > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > >
> > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Sounds like you have noise problems.ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Regarding the "runaway":ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> 100KHz.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > that basically make no physical sense which confuse the
> > > algorithm and causes a runaway
> > > > (It assumes the signals are aliasing at a high speed).
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > >
> > > >
> > > > From: himykabibble <jagboy@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > >
> > > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > >
> > > > Where to look?
> > > >
> > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > You can disable the "trick" by changing the line:
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > to
> > > > ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Please give this a try to see if it stops any runaways.
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Regards
> > > > TK
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2120 |
From: himykabibble |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Ross,
My hardware E-Stop WOULD stop it, as it cuts power to the drives with no software involvement whatsoever. But the Mach3 E-Stop does nothing when it gets in this mode.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Ross Ferguson <ferman@...> wrote:
>
> Hi Ray,
> I would agree that the behavior you mention is alarming.
> What I find extraordinarily alarming is that your E-Stop doesn't stop it.
> It should cut all power to all drives and disable all axes.
> That is assuming that your E-Stop is a big red button and not just the Reset in Mach3.
>
> Ross
>
> On 4/11/2011 12:59 PM, himykabibble wrote:
> >
> > Ya know, I find this behavior quite alarming, from a safety standpoint. Clearly, the KFlop is
> > setting up a pulse generator on the axis, and just letting it free-run, which is a really bad
> > thing to do. Loss of communication from the host (Mach3 in this case) should, in a short period of
> > time, automatically stop all motion, through a watchdog if necessary.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>, "himykabibble"
> > <jagboy@> wrote:
> > >
> > > I have only the four axes connected to my machine at present, and it seems to work fine,
> > except.... fairly often, when I jog, the axis will just take off and keep right on going until I
> > pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with
> > Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > >
> > > Where to look?
> > >
> > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no
> > problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This
> > is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really
> > concern me too much at the moment, however.
> > >
> > > Regards,
> > > Ray L.
> > >
> >
> >
>
> --
> Ferguson Windmills Company
> 835 Old North Road,
> R.D.2, Waimauku,
> New Zealand. 0882
> Ph 64 9 411 8332 Mobile 027 282 7689
> Fax 64 9 412 8655
> E-mail - ferman@...
> http://www.windmills.co.nz
>
|
|
Group: DynoMotion |
Message: 2121 |
From: tmday7 |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
One thing that might help in getting things up and going is to remove all plugins from Mach3, other than Dynomotion of course. If nothing-else, than just eliminating another possibility. I had a similar issue when i used a Shuttle Express from ContourDesigns. Except i could EStop Mach3 and it would stop all motion. But the problem i had would cause axis to run off at what ever speed i was jogging at. Dont think it ever happened with Keyboard jogging thow.
HTH
Troy
--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Allen,
>
> Yes, I do, and it normally works fine, but when the runaway occurs, E-stopping Mach3 has no effect - the axis just keeps on going, even if I close then re-open Mach3. That's why it appears to me the KFlop has stopped talking to Mach3.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, "Allen" <agray@> wrote:
> >
> > Hi Ray,
> >
> > Do you have an Enable output configured through Mach? I know as long as I have an Enable output setup up for my servo drives I can reset the software or close it and the drives will disable.
> >
> > I know this is not much of a suggestion and you have probably already done this but thought I would throw it out there :)
> >
> > Allen
> >
> >
> >
> >
> > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > >
> > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > >
> > > Where to look?
> > >
> > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > >
> > > Regards,
> > > Ray L.
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2124 |
From: himykabibble |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Troy,
Already did that - the only plug-in running, other than the KFlop, is Flash.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, "tmday7" <tmday@...> wrote:
>
> Hi Ray,
> One thing that might help in getting things up and going is to remove all plugins from Mach3, other than Dynomotion of course. If nothing-else, than just eliminating another possibility. I had a similar issue when i used a Shuttle Express from ContourDesigns. Except i could EStop Mach3 and it would stop all motion. But the problem i had would cause axis to run off at what ever speed i was jogging at. Dont think it ever happened with Keyboard jogging thow.
>
> HTH
> Troy
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Allen,
> >
> > Yes, I do, and it normally works fine, but when the runaway occurs, E-stopping Mach3 has no effect - the axis just keeps on going, even if I close then re-open Mach3. That's why it appears to me the KFlop has stopped talking to Mach3.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, "Allen" <agray@> wrote:
> > >
> > > Hi Ray,
> > >
> > > Do you have an Enable output configured through Mach? I know as long as I have an Enable output setup up for my servo drives I can reset the software or close it and the drives will disable.
> > >
> > > I know this is not much of a suggestion and you have probably already done this but thought I would throw it out there :)
> > >
> > > Allen
> > >
> > >
> > >
> > >
> > > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > >
> > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > >
> > > > Where to look?
> > > >
> > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2125 |
From: himykabibble |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> That is strange. The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> Â
> Can you give more clues like how often it happens, whether it does it when jogging cont. or steps? How is the runaway motion constant speed? Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> Â
> If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> Â
> Thanks
> TK
> Â
> Â
> Â
>
>
> ________________________________
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 3, 2011 7:54 PM
> Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Â
> Tom,
>
> Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > ÃÂ
> > You are correct there isn't any loop.ÃÂ I headed off in the totally wrong direction.
> > ÃÂ
> > I don't know what it could be.ÃÂ How were you jogging then anyway?ÃÂ With the keyboard?ÃÂ Didn't you say you had a modbus MPG?ÃÂ PoKeys?ÃÂ Do you have any external events defined in Mach3?
> > ÃÂ
> > Regards
> > TK
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 3, 2011 6:58 PM
> > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> >
> >
> > ÃÂ
> > Tom,
> >
> > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> >
> > #include "KMotionDef.h"
> > #include "MyCommonDefs.h"
> >
> > main()
> > {
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=70000;
> > ch0->Accel=500000;
> > ch0->Jerk=4e+006;
> > ch0->P=0;
> > ch0->I=0.01;
> > ch0->D=0;
> > ch0->FFAccel=0;
> > ch0->FFVel=0;
> > ch0->MaxI=200;
> > ch0->MaxErr=1e+006;
> > ch0->MaxOutput=200;
> > ch0->DeadBandGain=1;
> > ch0->DeadBandRange=0;
> > ch0->InputChan0=0;
> > ch0->InputChan1=0;
> > ch0->OutputChan0=8;
> > ch0->OutputChan1=0;
> > ch0->MasterAxis=-1;
> > ch0->LimitSwitchOptions=0x0;
> > ch0->InputGain0=1;
> > ch0->InputGain1=1;
> > ch0->InputOffset0=0;
> > ch0->InputOffset1=0;
> > ch0->OutputGain=1;
> > ch0->OutputOffset=0;
> > ch0->SlaveGain=1;
> > ch0->BacklashMode=BACKLASH_OFF;
> > ch0->BacklashAmount=0;
> > ch0->BacklashRate=0;
> > ch0->invDistPerCycle=1;
> > ch0->Lead=0;
> > ch0->MaxFollowingError=1000000000;
> > ch0->StepperAmplitude=20;
> >
> > ch0->iir[0].B0=1;
> > ch0->iir[0].B1=0;
> > ch0->iir[0].B2=0;
> > ch0->iir[0].A1=0;
> > ch0->iir[0].A2=0;
> >
> > ch0->iir[1].B0=1;
> > ch0->iir[1].B1=0;
> > ch0->iir[1].B2=0;
> > ch0->iir[1].A1=0;
> > ch0->iir[1].A2=0;
> >
> > ch0->iir[2].B0=0.000769;
> > ch0->iir[2].B1=0.001538;
> > ch0->iir[2].B2=0.000769;
> > ch0->iir[2].A1=1.92081;
> > ch0->iir[2].A2=-0.923885;
> >
> > EnableAxisDest(0,0);
> >
> > ch1->InputMode=NO_INPUT_MODE;
> > ch1->OutputMode=STEP_DIR_MODE;
> > ch1->Vel=70000;
> > ch1->Accel=500000;
> > ch1->Jerk=4e+006;
> > ch1->P=0;
> > ch1->I=0.01;
> > ch1->D=0;
> > ch1->FFAccel=0;
> > ch1->FFVel=0;
> > ch1->MaxI=200;
> > ch1->MaxErr=1e+006;
> > ch1->MaxOutput=200;
> > ch1->DeadBandGain=1;
> > ch1->DeadBandRange=0;
> > ch1->InputChan0=1;
> > ch1->InputChan1=0;
> > ch1->OutputChan0=9;
> > ch1->OutputChan1=0;
> > ch1->MasterAxis=-1;
> > ch1->LimitSwitchOptions=0x0;
> > ch1->InputGain0=1;
> > ch1->InputGain1=1;
> > ch1->InputOffset0=0;
> > ch1->InputOffset1=0;
> > ch1->OutputGain=1;
> > ch1->OutputOffset=0;
> > ch1->SlaveGain=1;
> > ch1->BacklashMode=BACKLASH_OFF;
> > ch1->BacklashAmount=0;
> > ch1->BacklashRate=0;
> > ch1->invDistPerCycle=1;
> > ch1->Lead=0;
> > ch1->MaxFollowingError=1000000000;
> > ch1->StepperAmplitude=20;
> >
> > ch1->iir[0].B0=1;
> > ch1->iir[0].B1=0;
> > ch1->iir[0].B2=0;
> > ch1->iir[0].A1=0;
> > ch1->iir[0].A2=0;
> >
> > ch1->iir[1].B0=1;
> > ch1->iir[1].B1=0;
> > ch1->iir[1].B2=0;
> > ch1->iir[1].A1=0;
> > ch1->iir[1].A2=0;
> >
> > ch1->iir[2].B0=0.000769;
> > ch1->iir[2].B1=0.001538;
> > ch1->iir[2].B2=0.000769;
> > ch1->iir[2].A1=1.92081;
> > ch1->iir[2].A2=-0.923885;
> >
> > EnableAxisDest(1,0);
> >
> > ch2->InputMode=NO_INPUT_MODE;
> > ch2->OutputMode=STEP_DIR_MODE;
> > ch2->Vel=51000;
> > ch2->Accel=700000;
> > ch2->Jerk=4e+006;
> > ch2->P=0;
> > ch2->I=0.01;
> > ch2->D=0;
> > ch2->FFAccel=0;
> > ch2->FFVel=0;
> > ch2->MaxI=200;
> > ch2->MaxErr=1e+006;
> > ch2->MaxOutput=200;
> > ch2->DeadBandGain=1;
> > ch2->DeadBandRange=0;
> > ch2->InputChan0=2;
> > ch2->InputChan1=0;
> > ch2->OutputChan0=10;
> > ch2->OutputChan1=0;
> > ch2->MasterAxis=-1;
> > ch2->LimitSwitchOptions=0x0;
> > ch2->InputGain0=1;
> > ch2->InputGain1=1;
> > ch2->InputOffset0=0;
> > ch2->InputOffset1=0;
> > ch2->OutputGain=1;
> > ch2->OutputOffset=0;
> > ch2->SlaveGain=1;
> > ch2->BacklashMode=BACKLASH_OFF;
> > ch2->BacklashAmount=0;
> > ch2->BacklashRate=0;
> > ch2->invDistPerCycle=1;
> > ch2->Lead=0;
> > ch2->MaxFollowingError=1000000000;
> > ch2->StepperAmplitude=20;
> >
> > ch2->iir[0].B0=1;
> > ch2->iir[0].B1=0;
> > ch2->iir[0].B2=0;
> > ch2->iir[0].A1=0;
> > ch2->iir[0].A2=0;
> >
> > ch2->iir[1].B0=1;
> > ch2->iir[1].B1=0;
> > ch2->iir[1].B2=0;
> > ch2->iir[1].A1=0;
> > ch2->iir[1].A2=0;
> >
> > ch2->iir[2].B0=0.000769;
> > ch2->iir[2].B1=0.001538;
> > ch2->iir[2].B2=0.000769;
> > ch2->iir[2].A1=1.92081;
> > ch2->iir[2].A2=-0.923885;
> >
> > EnableAxisDest(2,0);
> >
> > ch3->InputMode=NO_INPUT_MODE;
> > ch3->OutputMode=STEP_DIR_MODE;
> > ch3->Vel=80000;
> > ch3->Accel=40000;
> > ch3->Jerk=400000;
> > ch3->P=1;
> > ch3->I=0;
> > ch3->D=0;
> > ch3->FFAccel=0;
> > ch3->FFVel=0;
> > ch3->MaxI=200;
> > ch3->MaxErr=1e+006;
> > ch3->MaxOutput=200;
> > ch3->DeadBandGain=1;
> > ch3->DeadBandRange=0;
> > ch3->InputChan0=3;
> > ch3->InputChan1=3;
> > ch3->OutputChan0=11;
> > ch3->OutputChan1=7;
> > ch3->MasterAxis=-1;
> > ch3->LimitSwitchOptions=0x0;
> > ch3->InputGain0=1;
> > ch3->InputGain1=1;
> > ch3->InputOffset0=0;
> > ch3->InputOffset1=0;
> > ch3->OutputGain=1;
> > ch3->OutputOffset=0;
> > ch3->SlaveGain=1;
> > ch3->BacklashMode=BACKLASH_OFF;
> > ch3->BacklashAmount=0;
> > ch3->BacklashRate=0;
> > ch3->invDistPerCycle=1;
> > ch3->Lead=0;
> > ch3->MaxFollowingError=1000000000;
> > ch3->StepperAmplitude=20;
> >
> > ch3->iir[0].B0=1;
> > ch3->iir[0].B1=0;
> > ch3->iir[0].B2=0;
> > ch3->iir[0].A1=0;
> > ch3->iir[0].A2=0;
> >
> > ch3->iir[1].B0=1;
> > ch3->iir[1].B1=0;
> > ch3->iir[1].B2=0;
> > ch3->iir[1].A1=0;
> > ch3->iir[1].A2=0;
> >
> > ch3->iir[2].B0=1;
> > ch3->iir[2].B1=0;
> > ch3->iir[2].B2=0;
> > ch3->iir[2].A1=0;
> > ch3->iir[2].A2=0;
> >
> > EnableAxisDest(3,0);
> >
> > DefineCoordSystem(0,1,2,3);
> >
> > // Configure Enable bit as output, and clear it
> > SetBitDirection(ENABLE, 1);
> > //ClearBit(ENABLE);
> >
> > // Configure Spindle Control pins as outputs, and clear them
> > SetBitDirection(SPINDLE_CW, 1);
> > ClearBit(SPINDLE_CW);
> > SetBitDirection(SPINDLE_CCW, 1);
> > ClearBit(SPINDLE_CCW);
> > // Zero the spindle PWM output
> > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > FPGA(IO_PWMS+1) = 1; // Enable
> >
> > // Configure Coolant Control pins as outputs, and clear them
> > SetBitDirection(COOLANT_MIST, 1);
> > ClearBit(COOLANT_MIST);
> > SetBitDirection(COOLANT_FLOOD, 1);
> > ClearBit(COOLANT_FLOOD);
> >
> > // Configure Probe pin as input
> > SetBitDirection(PROBE, 0);
> >
> > // Configire E-Stop pin as input
> > SetBitDirection(ESTOP, 0);
> >
> > // Configure Home/Limit pin as input
> > SetBitDirection(HOME_LIMIT, 0);
> >
> > }
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃâÃÂ
> > > Only the programs that have been told to execute will be running.ÃâàÃâàI assumed you created and configured an Init.c program with the MPG code.ÃâàThat is a reqirement before you even try to run Mach3.ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > ÃâÃÂ
> > > Maybe you could postÃâàthe Init.c file you areÃâàconfigured to use.
> > > ÃâÃÂ
> > > Regards
> > > TK
> > > ÃâÃÂ
> > > ÃâàÃâÃÂ
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, November 3, 2011 5:54 PM
> > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > >
> > >
> > > ÃâÃÂ
> > > Tom,
> > >
> > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > >
> > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Sounds like you have noise problems.ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Regarding the "runaway":ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> 100KHz.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > that basically make no physical sense which confuse the
> > > algorithm and causes a runaway
> > > > (It assumes the signals are aliasing at a high speed).
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > >
> > > >
> > > > From: himykabibble <jagboy@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > >
> > > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > >
> > > > Where to look?
> > > >
> > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > You can disable the "trick" by changing the line:
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > to
> > > > ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Please give this a try to see if it stops any runaways.
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Regards
> > > > TK
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2126 |
From: himykabibble |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
KMotion seems to work OK - no runaway. If I start KMotion, then start Mach3, then jog until the runaway occurs, the motion is reflected in KMotion. If I then do a Disable Axis, Set the Dest for the axis to just beyond where it is, then EnableAxis, it starts right up again. If I first kill Mach3, then it does not start again no the EnableAxis, so it appears Mach3 is somehow commanding to move to somewhere on another planet.
I'm stumped. I'll post my init and XML in the Files area, as RayLsFiles.zip.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Tom,
>
> Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > Â
> > That is strange. The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> > Â
> > Can you give more clues like how often it happens, whether it does it when jogging cont. or steps? How is the runaway motion constant speed? Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> > Â
> > If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> > Â
> > Thanks
> > TK
> > Â
> > Â
> > Â
> >
> >
> > ________________________________
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 3, 2011 7:54 PM
> > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> >
> >
> > Â
> > Tom,
> >
> > Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃÂ
> > > You are correct there isn't any loop.ÃÂ I headed off in the totally wrong direction.
> > > ÃÂ
> > > I don't know what it could be.ÃÂ How were you jogging then anyway?ÃÂ With the keyboard?ÃÂ Didn't you say you had a modbus MPG?ÃÂ PoKeys?ÃÂ Do you have any external events defined in Mach3?
> > > ÃÂ
> > > Regards
> > > TK
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, November 3, 2011 6:58 PM
> > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > >
> > >
> > > ÃÂ
> > > Tom,
> > >
> > > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> > >
> > > #include "KMotionDef.h"
> > > #include "MyCommonDefs.h"
> > >
> > > main()
> > > {
> > > ch0->InputMode=NO_INPUT_MODE;
> > > ch0->OutputMode=STEP_DIR_MODE;
> > > ch0->Vel=70000;
> > > ch0->Accel=500000;
> > > ch0->Jerk=4e+006;
> > > ch0->P=0;
> > > ch0->I=0.01;
> > > ch0->D=0;
> > > ch0->FFAccel=0;
> > > ch0->FFVel=0;
> > > ch0->MaxI=200;
> > > ch0->MaxErr=1e+006;
> > > ch0->MaxOutput=200;
> > > ch0->DeadBandGain=1;
> > > ch0->DeadBandRange=0;
> > > ch0->InputChan0=0;
> > > ch0->InputChan1=0;
> > > ch0->OutputChan0=8;
> > > ch0->OutputChan1=0;
> > > ch0->MasterAxis=-1;
> > > ch0->LimitSwitchOptions=0x0;
> > > ch0->InputGain0=1;
> > > ch0->InputGain1=1;
> > > ch0->InputOffset0=0;
> > > ch0->InputOffset1=0;
> > > ch0->OutputGain=1;
> > > ch0->OutputOffset=0;
> > > ch0->SlaveGain=1;
> > > ch0->BacklashMode=BACKLASH_OFF;
> > > ch0->BacklashAmount=0;
> > > ch0->BacklashRate=0;
> > > ch0->invDistPerCycle=1;
> > > ch0->Lead=0;
> > > ch0->MaxFollowingError=1000000000;
> > > ch0->StepperAmplitude=20;
> > >
> > > ch0->iir[0].B0=1;
> > > ch0->iir[0].B1=0;
> > > ch0->iir[0].B2=0;
> > > ch0->iir[0].A1=0;
> > > ch0->iir[0].A2=0;
> > >
> > > ch0->iir[1].B0=1;
> > > ch0->iir[1].B1=0;
> > > ch0->iir[1].B2=0;
> > > ch0->iir[1].A1=0;
> > > ch0->iir[1].A2=0;
> > >
> > > ch0->iir[2].B0=0.000769;
> > > ch0->iir[2].B1=0.001538;
> > > ch0->iir[2].B2=0.000769;
> > > ch0->iir[2].A1=1.92081;
> > > ch0->iir[2].A2=-0.923885;
> > >
> > > EnableAxisDest(0,0);
> > >
> > > ch1->InputMode=NO_INPUT_MODE;
> > > ch1->OutputMode=STEP_DIR_MODE;
> > > ch1->Vel=70000;
> > > ch1->Accel=500000;
> > > ch1->Jerk=4e+006;
> > > ch1->P=0;
> > > ch1->I=0.01;
> > > ch1->D=0;
> > > ch1->FFAccel=0;
> > > ch1->FFVel=0;
> > > ch1->MaxI=200;
> > > ch1->MaxErr=1e+006;
> > > ch1->MaxOutput=200;
> > > ch1->DeadBandGain=1;
> > > ch1->DeadBandRange=0;
> > > ch1->InputChan0=1;
> > > ch1->InputChan1=0;
> > > ch1->OutputChan0=9;
> > > ch1->OutputChan1=0;
> > > ch1->MasterAxis=-1;
> > > ch1->LimitSwitchOptions=0x0;
> > > ch1->InputGain0=1;
> > > ch1->InputGain1=1;
> > > ch1->InputOffset0=0;
> > > ch1->InputOffset1=0;
> > > ch1->OutputGain=1;
> > > ch1->OutputOffset=0;
> > > ch1->SlaveGain=1;
> > > ch1->BacklashMode=BACKLASH_OFF;
> > > ch1->BacklashAmount=0;
> > > ch1->BacklashRate=0;
> > > ch1->invDistPerCycle=1;
> > > ch1->Lead=0;
> > > ch1->MaxFollowingError=1000000000;
> > > ch1->StepperAmplitude=20;
> > >
> > > ch1->iir[0].B0=1;
> > > ch1->iir[0].B1=0;
> > > ch1->iir[0].B2=0;
> > > ch1->iir[0].A1=0;
> > > ch1->iir[0].A2=0;
> > >
> > > ch1->iir[1].B0=1;
> > > ch1->iir[1].B1=0;
> > > ch1->iir[1].B2=0;
> > > ch1->iir[1].A1=0;
> > > ch1->iir[1].A2=0;
> > >
> > > ch1->iir[2].B0=0.000769;
> > > ch1->iir[2].B1=0.001538;
> > > ch1->iir[2].B2=0.000769;
> > > ch1->iir[2].A1=1.92081;
> > > ch1->iir[2].A2=-0.923885;
> > >
> > > EnableAxisDest(1,0);
> > >
> > > ch2->InputMode=NO_INPUT_MODE;
> > > ch2->OutputMode=STEP_DIR_MODE;
> > > ch2->Vel=51000;
> > > ch2->Accel=700000;
> > > ch2->Jerk=4e+006;
> > > ch2->P=0;
> > > ch2->I=0.01;
> > > ch2->D=0;
> > > ch2->FFAccel=0;
> > > ch2->FFVel=0;
> > > ch2->MaxI=200;
> > > ch2->MaxErr=1e+006;
> > > ch2->MaxOutput=200;
> > > ch2->DeadBandGain=1;
> > > ch2->DeadBandRange=0;
> > > ch2->InputChan0=2;
> > > ch2->InputChan1=0;
> > > ch2->OutputChan0=10;
> > > ch2->OutputChan1=0;
> > > ch2->MasterAxis=-1;
> > > ch2->LimitSwitchOptions=0x0;
> > > ch2->InputGain0=1;
> > > ch2->InputGain1=1;
> > > ch2->InputOffset0=0;
> > > ch2->InputOffset1=0;
> > > ch2->OutputGain=1;
> > > ch2->OutputOffset=0;
> > > ch2->SlaveGain=1;
> > > ch2->BacklashMode=BACKLASH_OFF;
> > > ch2->BacklashAmount=0;
> > > ch2->BacklashRate=0;
> > > ch2->invDistPerCycle=1;
> > > ch2->Lead=0;
> > > ch2->MaxFollowingError=1000000000;
> > > ch2->StepperAmplitude=20;
> > >
> > > ch2->iir[0].B0=1;
> > > ch2->iir[0].B1=0;
> > > ch2->iir[0].B2=0;
> > > ch2->iir[0].A1=0;
> > > ch2->iir[0].A2=0;
> > >
> > > ch2->iir[1].B0=1;
> > > ch2->iir[1].B1=0;
> > > ch2->iir[1].B2=0;
> > > ch2->iir[1].A1=0;
> > > ch2->iir[1].A2=0;
> > >
> > > ch2->iir[2].B0=0.000769;
> > > ch2->iir[2].B1=0.001538;
> > > ch2->iir[2].B2=0.000769;
> > > ch2->iir[2].A1=1.92081;
> > > ch2->iir[2].A2=-0.923885;
> > >
> > > EnableAxisDest(2,0);
> > >
> > > ch3->InputMode=NO_INPUT_MODE;
> > > ch3->OutputMode=STEP_DIR_MODE;
> > > ch3->Vel=80000;
> > > ch3->Accel=40000;
> > > ch3->Jerk=400000;
> > > ch3->P=1;
> > > ch3->I=0;
> > > ch3->D=0;
> > > ch3->FFAccel=0;
> > > ch3->FFVel=0;
> > > ch3->MaxI=200;
> > > ch3->MaxErr=1e+006;
> > > ch3->MaxOutput=200;
> > > ch3->DeadBandGain=1;
> > > ch3->DeadBandRange=0;
> > > ch3->InputChan0=3;
> > > ch3->InputChan1=3;
> > > ch3->OutputChan0=11;
> > > ch3->OutputChan1=7;
> > > ch3->MasterAxis=-1;
> > > ch3->LimitSwitchOptions=0x0;
> > > ch3->InputGain0=1;
> > > ch3->InputGain1=1;
> > > ch3->InputOffset0=0;
> > > ch3->InputOffset1=0;
> > > ch3->OutputGain=1;
> > > ch3->OutputOffset=0;
> > > ch3->SlaveGain=1;
> > > ch3->BacklashMode=BACKLASH_OFF;
> > > ch3->BacklashAmount=0;
> > > ch3->BacklashRate=0;
> > > ch3->invDistPerCycle=1;
> > > ch3->Lead=0;
> > > ch3->MaxFollowingError=1000000000;
> > > ch3->StepperAmplitude=20;
> > >
> > > ch3->iir[0].B0=1;
> > > ch3->iir[0].B1=0;
> > > ch3->iir[0].B2=0;
> > > ch3->iir[0].A1=0;
> > > ch3->iir[0].A2=0;
> > >
> > > ch3->iir[1].B0=1;
> > > ch3->iir[1].B1=0;
> > > ch3->iir[1].B2=0;
> > > ch3->iir[1].A1=0;
> > > ch3->iir[1].A2=0;
> > >
> > > ch3->iir[2].B0=1;
> > > ch3->iir[2].B1=0;
> > > ch3->iir[2].B2=0;
> > > ch3->iir[2].A1=0;
> > > ch3->iir[2].A2=0;
> > >
> > > EnableAxisDest(3,0);
> > >
> > > DefineCoordSystem(0,1,2,3);
> > >
> > > // Configure Enable bit as output, and clear it
> > > SetBitDirection(ENABLE, 1);
> > > //ClearBit(ENABLE);
> > >
> > > // Configure Spindle Control pins as outputs, and clear them
> > > SetBitDirection(SPINDLE_CW, 1);
> > > ClearBit(SPINDLE_CW);
> > > SetBitDirection(SPINDLE_CCW, 1);
> > > ClearBit(SPINDLE_CCW);
> > > // Zero the spindle PWM output
> > > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > > FPGA(IO_PWMS+1) = 1; // Enable
> > >
> > > // Configure Coolant Control pins as outputs, and clear them
> > > SetBitDirection(COOLANT_MIST, 1);
> > > ClearBit(COOLANT_MIST);
> > > SetBitDirection(COOLANT_FLOOD, 1);
> > > ClearBit(COOLANT_FLOOD);
> > >
> > > // Configure Probe pin as input
> > > SetBitDirection(PROBE, 0);
> > >
> > > // Configire E-Stop pin as input
> > > SetBitDirection(ESTOP, 0);
> > >
> > > // Configure Home/Limit pin as input
> > > SetBitDirection(HOME_LIMIT, 0);
> > >
> > > }
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > > ÃâÃÂ
> > > > Only the programs that have been told to execute will be running.ÃâàÃâàI assumed you created and configured an Init.c program with the MPG code.ÃâàThat is a reqirement before you even try to run Mach3.ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > > ÃâÃÂ
> > > > Maybe you could postÃâàthe Init.c file you areÃâàconfigured to use.
> > > > ÃâÃÂ
> > > > Regards
> > > > TK
> > > > ÃâÃÂ
> > > > ÃâàÃâÃÂ
> > > >
> > > > From: himykabibble <jagboy@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 3, 2011 5:54 PM
> > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > >
> > > >
> > > > ÃâÃÂ
> > > > Tom,
> > > >
> > > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > > >
> > > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Sounds like you have noise problems.ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Regarding the "runaway":ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> > 100KHz.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > > that basically make no physical sense which confuse the
> > > > algorithm and causes a runaway
> > > > > (It assumes the signals are aliasing at a high speed).
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > >
> > > > >
> > > > > From: himykabibble <jagboy@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > > >
> > > > >
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > > >
> > > > > Where to look?
> > > > >
> > > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > You can disable the "trick" by changing the line:
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > > to
> > > > > ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Please give this a try to see if it stops any runaways.
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Regards
> > > > > TK
> > > > >
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2127 |
From: Tom Kerekes |
Date: 11/4/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
So far I haven't been able to get it to runaway. I do see the problem with EStop when I jog Y. This is because the Mach3 EStop Input is configured as IO bit 10 which is the Y Step Output. Change it to something unused. I changed it to IO 46 which is one of the KFLOP LEDs.
The Init.c program is setting all the Destinations to zero by using the calls of:
EnableAxisDest(0,0); EnableAxisDest(1,0); EnableAxisDest(2,0); EnableAxisDest(3,0);
This is why all the Mach3 DROs are cleared after a RESET. If you want to do something else we can change the Init.c program to do so.
I see a lot of IO configured in Mach3 which is unnecessary. All the Step/Dir ,Spindle Outputs will be controlled by KFLOP so there is no need to configure them in Mach3. Mach3 Outputs #1 and #2 are configured as IO 14 and 16. Bit 14 conficts with KFLOP axis A Step Output. Outputs #5 and #6 are set to port 2 which is also used by KFLOP for IO 128-255. Disable all these or set all these as port 0 to effectively disable them.
I don't have the screen set you are using. Can you just use the standard 1024.set until we get you running?
You have a MacroPump enabled but didn't send me the Macropump code. Let's disable it until things are sorted out.
Could you send me your Spindle C program so I have it.
ModBus support is enabled. Let's disable it.
MPG #1 is configured in Mach3 let's disable it.
Mach3 Port #2 is enabled let's disable it.
I'm using Mach3 Version 3.42.36 what version are you using?
I'm using KMotion V4.27
What exactly do you do to get it to run away?
Thanks
TK
Group: DynoMotion |
Message: 2129 |
From: himykabibble |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
Obviously, my experience with the SmoothStepper is hurting me here. The SS duplicates PP I/O, so you can have a single configuration that will work with the SS or the PP, just by swapping the cables.
So, I've disabled virtually all I/O, except the four axes and the Enable - no spindle, no MPGs, no Modbus, no macropump, no limits, no homes, etc. Using 1024.set (oddly, the keyboard jog keys do not work....). The Y axis/E-Stop problem is gone, which makes sense. The jog runaway is still there. What seems to trigger it is hitting a jog key while it's coasting down from a previous jog. This is easiest to trigger on the A axis, since it has low acceleration. Hold down the on-screen 4+ key (on the jog flyout) for about 2 seconds, then release it and hit the 4- key. The axis should just keep moving. It's 100% repeatable here.
I've updated the XML in the Zip file to reflect these changes.
On the Destinations - the correct behavior, IMHO, is to leave the axis positions alone, except on power-up it should restore the positions it had at shut-down. That is how Mach3 behaves with the PP and SS. The motor init code was cut/pasted straight from KMotion.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> So far I haven't been able to get it to runaway. I do see the problem with EStop when I jog Y. This is because the Mach3 EStop Input is configured as IO bit 10 which is the Y Step Output. Change it to something unused. I changed it to IO 46 which is one of the KFLOP LEDs.
> Â
> The Init.c program is setting all the Destinations to zero by using the calls of:
> Â
> Â EnableAxisDest(0,0);
> Â EnableAxisDest(1,0);
> Â EnableAxisDest(2,0);
> Â EnableAxisDest(3,0);
> Â
> This is why all the Mach3 DROs are cleared after a RESET. If you want to do something else we can change the Init.c program to do so.
> Â
> I see a lot of IO configured in Mach3 which is unnecessary. All the Step/Dir ,Spindle Outputs will be controlled by KFLOP so there is no need to configure them in Mach3.  Mach3 Outputs #1 and #2 are configured as IO 14 and 16. Bit 14 conficts with KFLOP axis A Step Output. Outputs #5 and #6 are set to port 2 which is also used by KFLOP for IO 128-255. Disable all these or set all these as port 0 to effectively disable them.
> Â
> I don't have the screen set you are using. Can you just use the standard 1024.set until we get you running?
> Â
> You have a MacroPump enabled but didn't send me the Macropump code. Let's disable it until things are sorted out.
> Â
> Could you send me your Spindle C program so I have it.Â
> Â
> ModBus support is enabled. Let's disable it.
> Â
> MPG #1 is configured in Mach3 let's disable it.
> Â
> Mach3 Port #2 is enabled let's disable it.
> Â
> I'm using Mach3 Version 3.42.36 what version are you using?
> Â
> I'm using KMotion V4.27
> Â
> What exactly do you do to get it to run away?
> Â
> Thanks
> TK
> Â
> Â
> Â
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 4, 2011 8:34 PM
> Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Â
> KMotion seems to work OK - no runaway. If I start KMotion, then start Mach3, then jog until the runaway occurs, the motion is reflected in KMotion. If I then do a Disable Axis, Set the Dest for the axis to just beyond where it is, then EnableAxis, it starts right up again. If I first kill Mach3, then it does not start again no the EnableAxis, so it appears Mach3 is somehow commanding to move to somewhere on another planet.
>
> I'm stumped. I'll post my init and XML in the Files area, as RayLsFiles.zip.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Tom,
> >
> > Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃÂ
> > > That is strange.ÃÂ The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> > > ÃÂ
> > > Can you give more clues like how often it happens, whether it does it when jogging cont. or steps?ÃÂ How is the runaway motion constant speed?ÃÂ Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> > > ÃÂ
> > > If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> > > ÃÂ
> > > Thanks
> > > TK
> > > ÃÂ
> > > ÃÂ
> > > ÃÂ
> > >
> > >
> > > ________________________________
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, November 3, 2011 7:54 PM
> > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > >
> > >
> > > ÃÂ
> > > Tom,
> > >
> > > Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > > ÃâÃÂ
> > > > You are correct there isn't any loop.ÃâàI headed off in the totally wrong direction.
> > > > ÃâÃÂ
> > > > I don't know what it could be.ÃâàHow were you jogging then anyway?ÃâàWith the keyboard?ÃâàDidn't you say you had a modbus MPG?ÃâàPoKeys?ÃâàDo you have any external events defined in Mach3?
> > > > ÃâÃÂ
> > > > Regards
> > > > TK
> > > >
> > > > From: himykabibble <jagboy@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 3, 2011 6:58 PM
> > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > >
> > > >
> > > > ÃâÃÂ
> > > > Tom,
> > > >
> > > > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> > > >
> > > > #include "KMotionDef.h"
> > > > #include "MyCommonDefs.h"
> > > >
> > > > main()
> > > > {
> > > > ch0->InputMode=NO_INPUT_MODE;
> > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > ch0->Vel=70000;
> > > > ch0->Accel=500000;
> > > > ch0->Jerk=4e+006;
> > > > ch0->P=0;
> > > > ch0->I=0.01;
> > > > ch0->D=0;
> > > > ch0->FFAccel=0;
> > > > ch0->FFVel=0;
> > > > ch0->MaxI=200;
> > > > ch0->MaxErr=1e+006;
> > > > ch0->MaxOutput=200;
> > > > ch0->DeadBandGain=1;
> > > > ch0->DeadBandRange=0;
> > > > ch0->InputChan0=0;
> > > > ch0->InputChan1=0;
> > > > ch0->OutputChan0=8;
> > > > ch0->OutputChan1=0;
> > > > ch0->MasterAxis=-1;
> > > > ch0->LimitSwitchOptions=0x0;
> > > > ch0->InputGain0=1;
> > > > ch0->InputGain1=1;
> > > > ch0->InputOffset0=0;
> > > > ch0->InputOffset1=0;
> > > > ch0->OutputGain=1;
> > > > ch0->OutputOffset=0;
> > > > ch0->SlaveGain=1;
> > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > ch0->BacklashAmount=0;
> > > > ch0->BacklashRate=0;
> > > > ch0->invDistPerCycle=1;
> > > > ch0->Lead=0;
> > > > ch0->MaxFollowingError=1000000000;
> > > > ch0->StepperAmplitude=20;
> > > >
> > > > ch0->iir[0].B0=1;
> > > > ch0->iir[0].B1=0;
> > > > ch0->iir[0].B2=0;
> > > > ch0->iir[0].A1=0;
> > > > ch0->iir[0].A2=0;
> > > >
> > > > ch0->iir[1].B0=1;
> > > > ch0->iir[1].B1=0;
> > > > ch0->iir[1].B2=0;
> > > > ch0->iir[1].A1=0;
> > > > ch0->iir[1].A2=0;
> > > >
> > > > ch0->iir[2].B0=0.000769;
> > > > ch0->iir[2].B1=0.001538;
> > > > ch0->iir[2].B2=0.000769;
> > > > ch0->iir[2].A1=1.92081;
> > > > ch0->iir[2].A2=-0.923885;
> > > >
> > > > EnableAxisDest(0,0);
> > > >
> > > > ch1->InputMode=NO_INPUT_MODE;
> > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > ch1->Vel=70000;
> > > > ch1->Accel=500000;
> > > > ch1->Jerk=4e+006;
> > > > ch1->P=0;
> > > > ch1->I=0.01;
> > > > ch1->D=0;
> > > > ch1->FFAccel=0;
> > > > ch1->FFVel=0;
> > > > ch1->MaxI=200;
> > > > ch1->MaxErr=1e+006;
> > > > ch1->MaxOutput=200;
> > > > ch1->DeadBandGain=1;
> > > > ch1->DeadBandRange=0;
> > > > ch1->InputChan0=1;
> > > > ch1->InputChan1=0;
> > > > ch1->OutputChan0=9;
> > > > ch1->OutputChan1=0;
> > > > ch1->MasterAxis=-1;
> > > > ch1->LimitSwitchOptions=0x0;
> > > > ch1->InputGain0=1;
> > > > ch1->InputGain1=1;
> > > > ch1->InputOffset0=0;
> > > > ch1->InputOffset1=0;
> > > > ch1->OutputGain=1;
> > > > ch1->OutputOffset=0;
> > > > ch1->SlaveGain=1;
> > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > ch1->BacklashAmount=0;
> > > > ch1->BacklashRate=0;
> > > > ch1->invDistPerCycle=1;
> > > > ch1->Lead=0;
> > > > ch1->MaxFollowingError=1000000000;
> > > > ch1->StepperAmplitude=20;
> > > >
> > > > ch1->iir[0].B0=1;
> > > > ch1->iir[0].B1=0;
> > > > ch1->iir[0].B2=0;
> > > > ch1->iir[0].A1=0;
> > > > ch1->iir[0].A2=0;
> > > >
> > > > ch1->iir[1].B0=1;
> > > > ch1->iir[1].B1=0;
> > > > ch1->iir[1].B2=0;
> > > > ch1->iir[1].A1=0;
> > > > ch1->iir[1].A2=0;
> > > >
> > > > ch1->iir[2].B0=0.000769;
> > > > ch1->iir[2].B1=0.001538;
> > > > ch1->iir[2].B2=0.000769;
> > > > ch1->iir[2].A1=1.92081;
> > > > ch1->iir[2].A2=-0.923885;
> > > >
> > > > EnableAxisDest(1,0);
> > > >
> > > > ch2->InputMode=NO_INPUT_MODE;
> > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > ch2->Vel=51000;
> > > > ch2->Accel=700000;
> > > > ch2->Jerk=4e+006;
> > > > ch2->P=0;
> > > > ch2->I=0.01;
> > > > ch2->D=0;
> > > > ch2->FFAccel=0;
> > > > ch2->FFVel=0;
> > > > ch2->MaxI=200;
> > > > ch2->MaxErr=1e+006;
> > > > ch2->MaxOutput=200;
> > > > ch2->DeadBandGain=1;
> > > > ch2->DeadBandRange=0;
> > > > ch2->InputChan0=2;
> > > > ch2->InputChan1=0;
> > > > ch2->OutputChan0=10;
> > > > ch2->OutputChan1=0;
> > > > ch2->MasterAxis=-1;
> > > > ch2->LimitSwitchOptions=0x0;
> > > > ch2->InputGain0=1;
> > > > ch2->InputGain1=1;
> > > > ch2->InputOffset0=0;
> > > > ch2->InputOffset1=0;
> > > > ch2->OutputGain=1;
> > > > ch2->OutputOffset=0;
> > > > ch2->SlaveGain=1;
> > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > ch2->BacklashAmount=0;
> > > > ch2->BacklashRate=0;
> > > > ch2->invDistPerCycle=1;
> > > > ch2->Lead=0;
> > > > ch2->MaxFollowingError=1000000000;
> > > > ch2->StepperAmplitude=20;
> > > >
> > > > ch2->iir[0].B0=1;
> > > > ch2->iir[0].B1=0;
> > > > ch2->iir[0].B2=0;
> > > > ch2->iir[0].A1=0;
> > > > ch2->iir[0].A2=0;
> > > >
> > > > ch2->iir[1].B0=1;
> > > > ch2->iir[1].B1=0;
> > > > ch2->iir[1].B2=0;
> > > > ch2->iir[1].A1=0;
> > > > ch2->iir[1].A2=0;
> > > >
> > > > ch2->iir[2].B0=0.000769;
> > > > ch2->iir[2].B1=0.001538;
> > > > ch2->iir[2].B2=0.000769;
> > > > ch2->iir[2].A1=1.92081;
> > > > ch2->iir[2].A2=-0.923885;
> > > >
> > > > EnableAxisDest(2,0);
> > > >
> > > > ch3->InputMode=NO_INPUT_MODE;
> > > > ch3->OutputMode=STEP_DIR_MODE;
> > > > ch3->Vel=80000;
> > > > ch3->Accel=40000;
> > > > ch3->Jerk=400000;
> > > > ch3->P=1;
> > > > ch3->I=0;
> > > > ch3->D=0;
> > > > ch3->FFAccel=0;
> > > > ch3->FFVel=0;
> > > > ch3->MaxI=200;
> > > > ch3->MaxErr=1e+006;
> > > > ch3->MaxOutput=200;
> > > > ch3->DeadBandGain=1;
> > > > ch3->DeadBandRange=0;
> > > > ch3->InputChan0=3;
> > > > ch3->InputChan1=3;
> > > > ch3->OutputChan0=11;
> > > > ch3->OutputChan1=7;
> > > > ch3->MasterAxis=-1;
> > > > ch3->LimitSwitchOptions=0x0;
> > > > ch3->InputGain0=1;
> > > > ch3->InputGain1=1;
> > > > ch3->InputOffset0=0;
> > > > ch3->InputOffset1=0;
> > > > ch3->OutputGain=1;
> > > > ch3->OutputOffset=0;
> > > > ch3->SlaveGain=1;
> > > > ch3->BacklashMode=BACKLASH_OFF;
> > > > ch3->BacklashAmount=0;
> > > > ch3->BacklashRate=0;
> > > > ch3->invDistPerCycle=1;
> > > > ch3->Lead=0;
> > > > ch3->MaxFollowingError=1000000000;
> > > > ch3->StepperAmplitude=20;
> > > >
> > > > ch3->iir[0].B0=1;
> > > > ch3->iir[0].B1=0;
> > > > ch3->iir[0].B2=0;
> > > > ch3->iir[0].A1=0;
> > > > ch3->iir[0].A2=0;
> > > >
> > > > ch3->iir[1].B0=1;
> > > > ch3->iir[1].B1=0;
> > > > ch3->iir[1].B2=0;
> > > > ch3->iir[1].A1=0;
> > > > ch3->iir[1].A2=0;
> > > >
> > > > ch3->iir[2].B0=1;
> > > > ch3->iir[2].B1=0;
> > > > ch3->iir[2].B2=0;
> > > > ch3->iir[2].A1=0;
> > > > ch3->iir[2].A2=0;
> > > >
> > > > EnableAxisDest(3,0);
> > > >
> > > > DefineCoordSystem(0,1,2,3);
> > > >
> > > > // Configure Enable bit as output, and clear it
> > > > SetBitDirection(ENABLE, 1);
> > > > //ClearBit(ENABLE);
> > > >
> > > > // Configure Spindle Control pins as outputs, and clear them
> > > > SetBitDirection(SPINDLE_CW, 1);
> > > > ClearBit(SPINDLE_CW);
> > > > SetBitDirection(SPINDLE_CCW, 1);
> > > > ClearBit(SPINDLE_CCW);
> > > > // Zero the spindle PWM output
> > > > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > > > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > > > FPGA(IO_PWMS+1) = 1; // Enable
> > > >
> > > > // Configure Coolant Control pins as outputs, and clear them
> > > > SetBitDirection(COOLANT_MIST, 1);
> > > > ClearBit(COOLANT_MIST);
> > > > SetBitDirection(COOLANT_FLOOD, 1);
> > > > ClearBit(COOLANT_FLOOD);
> > > >
> > > > // Configure Probe pin as input
> > > > SetBitDirection(PROBE, 0);
> > > >
> > > > // Configire E-Stop pin as input
> > > > SetBitDirection(ESTOP, 0);
> > > >
> > > > // Configure Home/Limit pin as input
> > > > SetBitDirection(HOME_LIMIT, 0);
> > > >
> > > > }
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Only the programs that have been told to execute will be running.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàI assumed you created and configured an Init.c program with the MPG code.ÃÆ'ââ¬Å¡ÃâàThat is a reqirement before you even try to run Mach3.ÃÆ'ââ¬Å¡ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃÆ'ââ¬Å¡ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Maybe you could postÃÆ'ââ¬Å¡Ãâàthe Init.c file you areÃÆ'ââ¬Å¡Ãâàconfigured to use.
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Regards
> > > > > TK
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > >
> > > > > From: himykabibble <jagboy@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 3, 2011 5:54 PM
> > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > >
> > > > >
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Tom,
> > > > >
> > > > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > > > >
> > > > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi Ray,
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Sounds like you have noise problems.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Regarding the "runaway":ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the
> encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> > > 100KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > > > that basically make no physical sense which confuse the
> > > > > algorithm and causes a runaway
> > > > > > (It assumes the signals are aliasing at a high speed).
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > >
> > > > > >
> > > > > > From: himykabibble <jagboy@>
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > > > >
> > > > > >
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > > > >
> > > > > > Where to look?
> > > > > >
> > > > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > You can disable the "trick" by changing the line:
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > > > to
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Please give this a try to see if it stops any runaways.
> > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > >
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2130 |
From: carlcnc |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Ray
pardon my jumping in here and no offense intended,and in no
way am I an expert but I will bet you a nice lunch that Kflop is not the source of this problem
I have built 12 machines using Kflop and over 20 with Mach and CncPro before that
I have one customer who experienced odd behaviors with a laptop
drove us both nuts, finally got him to try a different puter and all is well , I think the first one was a 6 year old compaq
I used Mach for years and it does have some inexplicable random problems with some computers.especially laptops due to the hardware
and firmware power saving "tricks" they use vs desktop machines
Have you tried running mach in parallel port/demo mode with Kflop
not connected?
Is this a computer you previously used with SS? did it work OK
with this same computer? You might try adding a powered usb hub many computers do not have enough power on the usb for either SS or Kflop,
I know another machine builder who use SS and had issues using
mini-itx and/or laptops until he built a circuit to "boost" the usb 5v and current
just my 2cents
Carl
--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Tom,
>
> Obviously, my experience with the SmoothStepper is hurting me here. The SS duplicates PP I/O, so you can have a single configuration that will work with the SS or the PP, just by swapping the cables.
>
> So, I've disabled virtually all I/O, except the four axes and the Enable - no spindle, no MPGs, no Modbus, no macropump, no limits, no homes, etc. Using 1024.set (oddly, the keyboard jog keys do not work....). The Y axis/E-Stop problem is gone, which makes sense. The jog runaway is still there. What seems to trigger it is hitting a jog key while it's coasting down from a previous jog. This is easiest to trigger on the A axis, since it has low acceleration. Hold down the on-screen 4+ key (on the jog flyout) for about 2 seconds, then release it and hit the 4- key. The axis should just keep moving. It's 100% repeatable here.
>
> I've updated the XML in the Zip file to reflect these changes.
>
> On the Destinations - the correct behavior, IMHO, is to leave the axis positions alone, except on power-up it should restore the positions it had at shut-down. That is how Mach3 behaves with the PP and SS. The motor init code was cut/pasted straight from KMotion.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > Â
> > So far I haven't been able to get it to runaway. I do see the problem with EStop when I jog Y. This is because the Mach3 EStop Input is configured as IO bit 10 which is the Y Step Output. Change it to something unused. I changed it to IO 46 which is one of the KFLOP LEDs.
> > Â
> > The Init.c program is setting all the Destinations to zero by using the calls of:
> > Â
> > Â EnableAxisDest(0,0);
> > Â EnableAxisDest(1,0);
> > Â EnableAxisDest(2,0);
> > Â EnableAxisDest(3,0);
> > Â
> > This is why all the Mach3 DROs are cleared after a RESET. If you want to do something else we can change the Init.c program to do so.
> > Â
> > I see a lot of IO configured in Mach3 which is unnecessary. All the Step/Dir ,Spindle Outputs will be controlled by KFLOP so there is no need to configure them in Mach3.  Mach3 Outputs #1 and #2 are configured as IO 14 and 16. Bit 14 conficts with KFLOP axis A Step Output. Outputs #5 and #6 are set to port 2 which is also used by KFLOP for IO 128-255. Disable all these or set all these as port 0 to effectively disable them.
> > Â
> > I don't have the screen set you are using. Can you just use the standard 1024.set until we get you running?
> > Â
> > You have a MacroPump enabled but didn't send me the Macropump code. Let's disable it until things are sorted out.
> > Â
> > Could you send me your Spindle C program so I have it.Â
> > Â
> > ModBus support is enabled. Let's disable it.
> > Â
> > MPG #1 is configured in Mach3 let's disable it.
> > Â
> > Mach3 Port #2 is enabled let's disable it.
> > Â
> > I'm using Mach3 Version 3.42.36 what version are you using?
> > Â
> > I'm using KMotion V4.27
> > Â
> > What exactly do you do to get it to run away?
> > Â
> > Thanks
> > TK
> > Â
> > Â
> > Â
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 4, 2011 8:34 PM
> > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> >
> >
> > Â
> > KMotion seems to work OK - no runaway. If I start KMotion, then start Mach3, then jog until the runaway occurs, the motion is reflected in KMotion. If I then do a Disable Axis, Set the Dest for the axis to just beyond where it is, then EnableAxis, it starts right up again. If I first kill Mach3, then it does not start again no the EnableAxis, so it appears Mach3 is somehow commanding to move to somewhere on another planet.
> >
> > I'm stumped. I'll post my init and XML in the Files area, as RayLsFiles.zip.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > >
> > > Tom,
> > >
> > > Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > > ÃÂ
> > > > That is strange.ÃÂ The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> > > > ÃÂ
> > > > Can you give more clues like how often it happens, whether it does it when jogging cont. or steps?ÃÂ How is the runaway motion constant speed?ÃÂ Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> > > > ÃÂ
> > > > If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> > > > ÃÂ
> > > > Thanks
> > > > TK
> > > > ÃÂ
> > > > ÃÂ
> > > > ÃÂ
> > > >
> > > >
> > > > ________________________________
> > > > From: himykabibble <jagboy@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 3, 2011 7:54 PM
> > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > >
> > > >
> > > > ÃÂ
> > > > Tom,
> > > >
> > > > Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > > ÃâÃÂ
> > > > > You are correct there isn't any loop.ÃâàI headed off in the totally wrong direction.
> > > > > ÃâÃÂ
> > > > > I don't know what it could be.ÃâàHow were you jogging then anyway?ÃâàWith the keyboard?ÃâàDidn't you say you had a modbus MPG?ÃâàPoKeys?ÃâàDo you have any external events defined in Mach3?
> > > > > ÃâÃÂ
> > > > > Regards
> > > > > TK
> > > > >
> > > > > From: himykabibble <jagboy@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 3, 2011 6:58 PM
> > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > >
> > > > >
> > > > > ÃâÃÂ
> > > > > Tom,
> > > > >
> > > > > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> > > > >
> > > > > #include "KMotionDef.h"
> > > > > #include "MyCommonDefs.h"
> > > > >
> > > > > main()
> > > > > {
> > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > ch0->Vel=70000;
> > > > > ch0->Accel=500000;
> > > > > ch0->Jerk=4e+006;
> > > > > ch0->P=0;
> > > > > ch0->I=0.01;
> > > > > ch0->D=0;
> > > > > ch0->FFAccel=0;
> > > > > ch0->FFVel=0;
> > > > > ch0->MaxI=200;
> > > > > ch0->MaxErr=1e+006;
> > > > > ch0->MaxOutput=200;
> > > > > ch0->DeadBandGain=1;
> > > > > ch0->DeadBandRange=0;
> > > > > ch0->InputChan0=0;
> > > > > ch0->InputChan1=0;
> > > > > ch0->OutputChan0=8;
> > > > > ch0->OutputChan1=0;
> > > > > ch0->MasterAxis=-1;
> > > > > ch0->LimitSwitchOptions=0x0;
> > > > > ch0->InputGain0=1;
> > > > > ch0->InputGain1=1;
> > > > > ch0->InputOffset0=0;
> > > > > ch0->InputOffset1=0;
> > > > > ch0->OutputGain=1;
> > > > > ch0->OutputOffset=0;
> > > > > ch0->SlaveGain=1;
> > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > ch0->BacklashAmount=0;
> > > > > ch0->BacklashRate=0;
> > > > > ch0->invDistPerCycle=1;
> > > > > ch0->Lead=0;
> > > > > ch0->MaxFollowingError=1000000000;
> > > > > ch0->StepperAmplitude=20;
> > > > >
> > > > > ch0->iir[0].B0=1;
> > > > > ch0->iir[0].B1=0;
> > > > > ch0->iir[0].B2=0;
> > > > > ch0->iir[0].A1=0;
> > > > > ch0->iir[0].A2=0;
> > > > >
> > > > > ch0->iir[1].B0=1;
> > > > > ch0->iir[1].B1=0;
> > > > > ch0->iir[1].B2=0;
> > > > > ch0->iir[1].A1=0;
> > > > > ch0->iir[1].A2=0;
> > > > >
> > > > > ch0->iir[2].B0=0.000769;
> > > > > ch0->iir[2].B1=0.001538;
> > > > > ch0->iir[2].B2=0.000769;
> > > > > ch0->iir[2].A1=1.92081;
> > > > > ch0->iir[2].A2=-0.923885;
> > > > >
> > > > > EnableAxisDest(0,0);
> > > > >
> > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > ch1->Vel=70000;
> > > > > ch1->Accel=500000;
> > > > > ch1->Jerk=4e+006;
> > > > > ch1->P=0;
> > > > > ch1->I=0.01;
> > > > > ch1->D=0;
> > > > > ch1->FFAccel=0;
> > > > > ch1->FFVel=0;
> > > > > ch1->MaxI=200;
> > > > > ch1->MaxErr=1e+006;
> > > > > ch1->MaxOutput=200;
> > > > > ch1->DeadBandGain=1;
> > > > > ch1->DeadBandRange=0;
> > > > > ch1->InputChan0=1;
> > > > > ch1->InputChan1=0;
> > > > > ch1->OutputChan0=9;
> > > > > ch1->OutputChan1=0;
> > > > > ch1->MasterAxis=-1;
> > > > > ch1->LimitSwitchOptions=0x0;
> > > > > ch1->InputGain0=1;
> > > > > ch1->InputGain1=1;
> > > > > ch1->InputOffset0=0;
> > > > > ch1->InputOffset1=0;
> > > > > ch1->OutputGain=1;
> > > > > ch1->OutputOffset=0;
> > > > > ch1->SlaveGain=1;
> > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > ch1->BacklashAmount=0;
> > > > > ch1->BacklashRate=0;
> > > > > ch1->invDistPerCycle=1;
> > > > > ch1->Lead=0;
> > > > > ch1->MaxFollowingError=1000000000;
> > > > > ch1->StepperAmplitude=20;
> > > > >
> > > > > ch1->iir[0].B0=1;
> > > > > ch1->iir[0].B1=0;
> > > > > ch1->iir[0].B2=0;
> > > > > ch1->iir[0].A1=0;
> > > > > ch1->iir[0].A2=0;
> > > > >
> > > > > ch1->iir[1].B0=1;
> > > > > ch1->iir[1].B1=0;
> > > > > ch1->iir[1].B2=0;
> > > > > ch1->iir[1].A1=0;
> > > > > ch1->iir[1].A2=0;
> > > > >
> > > > > ch1->iir[2].B0=0.000769;
> > > > > ch1->iir[2].B1=0.001538;
> > > > > ch1->iir[2].B2=0.000769;
> > > > > ch1->iir[2].A1=1.92081;
> > > > > ch1->iir[2].A2=-0.923885;
> > > > >
> > > > > EnableAxisDest(1,0);
> > > > >
> > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > ch2->Vel=51000;
> > > > > ch2->Accel=700000;
> > > > > ch2->Jerk=4e+006;
> > > > > ch2->P=0;
> > > > > ch2->I=0.01;
> > > > > ch2->D=0;
> > > > > ch2->FFAccel=0;
> > > > > ch2->FFVel=0;
> > > > > ch2->MaxI=200;
> > > > > ch2->MaxErr=1e+006;
> > > > > ch2->MaxOutput=200;
> > > > > ch2->DeadBandGain=1;
> > > > > ch2->DeadBandRange=0;
> > > > > ch2->InputChan0=2;
> > > > > ch2->InputChan1=0;
> > > > > ch2->OutputChan0=10;
> > > > > ch2->OutputChan1=0;
> > > > > ch2->MasterAxis=-1;
> > > > > ch2->LimitSwitchOptions=0x0;
> > > > > ch2->InputGain0=1;
> > > > > ch2->InputGain1=1;
> > > > > ch2->InputOffset0=0;
> > > > > ch2->InputOffset1=0;
> > > > > ch2->OutputGain=1;
> > > > > ch2->OutputOffset=0;
> > > > > ch2->SlaveGain=1;
> > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > ch2->BacklashAmount=0;
> > > > > ch2->BacklashRate=0;
> > > > > ch2->invDistPerCycle=1;
> > > > > ch2->Lead=0;
> > > > > ch2->MaxFollowingError=1000000000;
> > > > > ch2->StepperAmplitude=20;
> > > > >
> > > > > ch2->iir[0].B0=1;
> > > > > ch2->iir[0].B1=0;
> > > > > ch2->iir[0].B2=0;
> > > > > ch2->iir[0].A1=0;
> > > > > ch2->iir[0].A2=0;
> > > > >
> > > > > ch2->iir[1].B0=1;
> > > > > ch2->iir[1].B1=0;
> > > > > ch2->iir[1].B2=0;
> > > > > ch2->iir[1].A1=0;
> > > > > ch2->iir[1].A2=0;
> > > > >
> > > > > ch2->iir[2].B0=0.000769;
> > > > > ch2->iir[2].B1=0.001538;
> > > > > ch2->iir[2].B2=0.000769;
> > > > > ch2->iir[2].A1=1.92081;
> > > > > ch2->iir[2].A2=-0.923885;
> > > > >
> > > > > EnableAxisDest(2,0);
> > > > >
> > > > > ch3->InputMode=NO_INPUT_MODE;
> > > > > ch3->OutputMode=STEP_DIR_MODE;
> > > > > ch3->Vel=80000;
> > > > > ch3->Accel=40000;
> > > > > ch3->Jerk=400000;
> > > > > ch3->P=1;
> > > > > ch3->I=0;
> > > > > ch3->D=0;
> > > > > ch3->FFAccel=0;
> > > > > ch3->FFVel=0;
> > > > > ch3->MaxI=200;
> > > > > ch3->MaxErr=1e+006;
> > > > > ch3->MaxOutput=200;
> > > > > ch3->DeadBandGain=1;
> > > > > ch3->DeadBandRange=0;
> > > > > ch3->InputChan0=3;
> > > > > ch3->InputChan1=3;
> > > > > ch3->OutputChan0=11;
> > > > > ch3->OutputChan1=7;
> > > > > ch3->MasterAxis=-1;
> > > > > ch3->LimitSwitchOptions=0x0;
> > > > > ch3->InputGain0=1;
> > > > > ch3->InputGain1=1;
> > > > > ch3->InputOffset0=0;
> > > > > ch3->InputOffset1=0;
> > > > > ch3->OutputGain=1;
> > > > > ch3->OutputOffset=0;
> > > > > ch3->SlaveGain=1;
> > > > > ch3->BacklashMode=BACKLASH_OFF;
> > > > > ch3->BacklashAmount=0;
> > > > > ch3->BacklashRate=0;
> > > > > ch3->invDistPerCycle=1;
> > > > > ch3->Lead=0;
> > > > > ch3->MaxFollowingError=1000000000;
> > > > > ch3->StepperAmplitude=20;
> > > > >
> > > > > ch3->iir[0].B0=1;
> > > > > ch3->iir[0].B1=0;
> > > > > ch3->iir[0].B2=0;
> > > > > ch3->iir[0].A1=0;
> > > > > ch3->iir[0].A2=0;
> > > > >
> > > > > ch3->iir[1].B0=1;
> > > > > ch3->iir[1].B1=0;
> > > > > ch3->iir[1].B2=0;
> > > > > ch3->iir[1].A1=0;
> > > > > ch3->iir[1].A2=0;
> > > > >
> > > > > ch3->iir[2].B0=1;
> > > > > ch3->iir[2].B1=0;
> > > > > ch3->iir[2].B2=0;
> > > > > ch3->iir[2].A1=0;
> > > > > ch3->iir[2].A2=0;
> > > > >
> > > > > EnableAxisDest(3,0);
> > > > >
> > > > > DefineCoordSystem(0,1,2,3);
> > > > >
> > > > > // Configure Enable bit as output, and clear it
> > > > > SetBitDirection(ENABLE, 1);
> > > > > //ClearBit(ENABLE);
> > > > >
> > > > > // Configure Spindle Control pins as outputs, and clear them
> > > > > SetBitDirection(SPINDLE_CW, 1);
> > > > > ClearBit(SPINDLE_CW);
> > > > > SetBitDirection(SPINDLE_CCW, 1);
> > > > > ClearBit(SPINDLE_CCW);
> > > > > // Zero the spindle PWM output
> > > > > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > > > > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > > > > FPGA(IO_PWMS+1) = 1; // Enable
> > > > >
> > > > > // Configure Coolant Control pins as outputs, and clear them
> > > > > SetBitDirection(COOLANT_MIST, 1);
> > > > > ClearBit(COOLANT_MIST);
> > > > > SetBitDirection(COOLANT_FLOOD, 1);
> > > > > ClearBit(COOLANT_FLOOD);
> > > > >
> > > > > // Configure Probe pin as input
> > > > > SetBitDirection(PROBE, 0);
> > > > >
> > > > > // Configire E-Stop pin as input
> > > > > SetBitDirection(ESTOP, 0);
> > > > >
> > > > > // Configure Home/Limit pin as input
> > > > > SetBitDirection(HOME_LIMIT, 0);
> > > > >
> > > > > }
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi Ray,
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Only the programs that have been told to execute will be running.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàI assumed you created and configured an Init.c program with the MPG code.ÃÆ'ââ¬Å¡ÃâàThat is a reqirement before you even try to run Mach3.ÃÆ'ââ¬Å¡ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃÆ'ââ¬Å¡ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Maybe you could postÃÆ'ââ¬Å¡Ãâàthe Init.c file you areÃÆ'ââ¬Å¡Ãâàconfigured to use.
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > >
> > > > > > From: himykabibble <jagboy@>
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, November 3, 2011 5:54 PM
> > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > >
> > > > > >
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Tom,
> > > > > >
> > > > > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > > > > >
> > > > > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi Ray,
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Sounds like you have noise problems.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Regarding the "runaway":ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the
> > encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> > > > 100KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > > > > that basically make no physical sense which confuse the
> > > > > > algorithm and causes a runaway
> > > > > > > (It assumes the signals are aliasing at a high speed).
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > >
> > > > > > >
> > > > > > > From: himykabibble <jagboy@>
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > > > > >
> > > > > > > Where to look?
> > > > > > >
> > > > > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > > > > >
> > > > > > > Regards,
> > > > > > > Ray L.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > You can disable the "trick" by changing the line:
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > > > > to
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Please give this a try to see if it stops any runaways.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Regards
> > > > > > > TK
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2132 |
From: himykabibble |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Carl,
I don't believe it is a KFlop problem - it is a configuration problem. Everything seems to work fine with KMotion and KMotionCNC, so the problems appear to be restricted to Mach3. The PC in this case should be largely irrelevant, since it's not really being asked to do much, as all the "heavy lifting" is pushed off on the KFlop. I am currently running it on my laptop, but will try in the next few days installing it on the PC that's been running my machine for the last 3 years (with no problems OTHER than confirmed Mach3 and/or SmoothStepper bugs).
Obviously, I had some pretty bone-headed things in the configuration, as I was trying to take the existing configuration, and make minimal changes to it (as I was able to do easily when I installed the SS). I fully expect things to behave much better next time I hook it up to the machine, and will not be at all surprised if the jog runaway isn't about the only problem.
My ultimate goal is to abandon Mach3 entirely, and use KMotionCNC, but that will take a fair amount of code development, to get my pendant, probing and other essential functions working under KMotionCNC.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, "carlcnc" <cebcnc@...> wrote:
>
> Ray
> pardon my jumping in here and no offense intended,and in no
> way am I an expert but I will bet you a nice lunch that Kflop is not the source of this problem
> I have built 12 machines using Kflop and over 20 with Mach and CncPro before that
> I have one customer who experienced odd behaviors with a laptop
> drove us both nuts, finally got him to try a different puter and all is well , I think the first one was a 6 year old compaq
>
> I used Mach for years and it does have some inexplicable random problems with some computers.especially laptops due to the hardware
> and firmware power saving "tricks" they use vs desktop machines
> Have you tried running mach in parallel port/demo mode with Kflop
> not connected?
>
> Is this a computer you previously used with SS? did it work OK
> with this same computer? You might try adding a powered usb hub many computers do not have enough power on the usb for either SS or Kflop,
> I know another machine builder who use SS and had issues using
> mini-itx and/or laptops until he built a circuit to "boost" the usb 5v and current
> just my 2cents
> Carl
>
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Tom,
> >
> > Obviously, my experience with the SmoothStepper is hurting me here. The SS duplicates PP I/O, so you can have a single configuration that will work with the SS or the PP, just by swapping the cables.
> >
> > So, I've disabled virtually all I/O, except the four axes and the Enable - no spindle, no MPGs, no Modbus, no macropump, no limits, no homes, etc. Using 1024.set (oddly, the keyboard jog keys do not work....). The Y axis/E-Stop problem is gone, which makes sense. The jog runaway is still there. What seems to trigger it is hitting a jog key while it's coasting down from a previous jog. This is easiest to trigger on the A axis, since it has low acceleration. Hold down the on-screen 4+ key (on the jog flyout) for about 2 seconds, then release it and hit the 4- key. The axis should just keep moving. It's 100% repeatable here.
> >
> > I've updated the XML in the Zip file to reflect these changes.
> >
> > On the Destinations - the correct behavior, IMHO, is to leave the axis positions alone, except on power-up it should restore the positions it had at shut-down. That is how Mach3 behaves with the PP and SS. The motor init code was cut/pasted straight from KMotion.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > Â
> > > So far I haven't been able to get it to runaway. I do see the problem with EStop when I jog Y. This is because the Mach3 EStop Input is configured as IO bit 10 which is the Y Step Output. Change it to something unused. I changed it to IO 46 which is one of the KFLOP LEDs.
> > > Â
> > > The Init.c program is setting all the Destinations to zero by using the calls of:
> > > Â
> > > Â EnableAxisDest(0,0);
> > > Â EnableAxisDest(1,0);
> > > Â EnableAxisDest(2,0);
> > > Â EnableAxisDest(3,0);
> > > Â
> > > This is why all the Mach3 DROs are cleared after a RESET. If you want to do something else we can change the Init.c program to do so.
> > > Â
> > > I see a lot of IO configured in Mach3 which is unnecessary. All the Step/Dir ,Spindle Outputs will be controlled by KFLOP so there is no need to configure them in Mach3.  Mach3 Outputs #1 and #2 are configured as IO 14 and 16. Bit 14 conficts with KFLOP axis A Step Output. Outputs #5 and #6 are set to port 2 which is also used by KFLOP for IO 128-255. Disable all these or set all these as port 0 to effectively disable them.
> > > Â
> > > I don't have the screen set you are using. Can you just use the standard 1024.set until we get you running?
> > > Â
> > > You have a MacroPump enabled but didn't send me the Macropump code. Let's disable it until things are sorted out.
> > > Â
> > > Could you send me your Spindle C program so I have it.Â
> > > Â
> > > ModBus support is enabled. Let's disable it.
> > > Â
> > > MPG #1 is configured in Mach3 let's disable it.
> > > Â
> > > Mach3 Port #2 is enabled let's disable it.
> > > Â
> > > I'm using Mach3 Version 3.42.36 what version are you using?
> > > Â
> > > I'm using KMotion V4.27
> > > Â
> > > What exactly do you do to get it to run away?
> > > Â
> > > Thanks
> > > TK
> > > Â
> > > Â
> > > Â
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Friday, November 4, 2011 8:34 PM
> > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > >
> > >
> > > Â
> > > KMotion seems to work OK - no runaway. If I start KMotion, then start Mach3, then jog until the runaway occurs, the motion is reflected in KMotion. If I then do a Disable Axis, Set the Dest for the axis to just beyond where it is, then EnableAxis, it starts right up again. If I first kill Mach3, then it does not start again no the EnableAxis, so it appears Mach3 is somehow commanding to move to somewhere on another planet.
> > >
> > > I'm stumped. I'll post my init and XML in the Files area, as RayLsFiles.zip.
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > >
> > > > Tom,
> > > >
> > > > Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > > ÃÂ
> > > > > That is strange.ÃÂ The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> > > > > ÃÂ
> > > > > Can you give more clues like how often it happens, whether it does it when jogging cont. or steps?ÃÂ How is the runaway motion constant speed?ÃÂ Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> > > > > ÃÂ
> > > > > If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> > > > > ÃÂ
> > > > > Thanks
> > > > > TK
> > > > > ÃÂ
> > > > > ÃÂ
> > > > > ÃÂ
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: himykabibble <jagboy@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 3, 2011 7:54 PM
> > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > >
> > > > >
> > > > > ÃÂ
> > > > > Tom,
> > > > >
> > > > > Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi Ray,
> > > > > > ÃâÃÂ
> > > > > > You are correct there isn't any loop.ÃâàI headed off in the totally wrong direction.
> > > > > > ÃâÃÂ
> > > > > > I don't know what it could be.ÃâàHow were you jogging then anyway?ÃâàWith the keyboard?ÃâàDidn't you say you had a modbus MPG?ÃâàPoKeys?ÃâàDo you have any external events defined in Mach3?
> > > > > > ÃâÃÂ
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > > From: himykabibble <jagboy@>
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, November 3, 2011 6:58 PM
> > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > >
> > > > > >
> > > > > > ÃâÃÂ
> > > > > > Tom,
> > > > > >
> > > > > > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > > #include "MyCommonDefs.h"
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > ch0->Vel=70000;
> > > > > > ch0->Accel=500000;
> > > > > > ch0->Jerk=4e+006;
> > > > > > ch0->P=0;
> > > > > > ch0->I=0.01;
> > > > > > ch0->D=0;
> > > > > > ch0->FFAccel=0;
> > > > > > ch0->FFVel=0;
> > > > > > ch0->MaxI=200;
> > > > > > ch0->MaxErr=1e+006;
> > > > > > ch0->MaxOutput=200;
> > > > > > ch0->DeadBandGain=1;
> > > > > > ch0->DeadBandRange=0;
> > > > > > ch0->InputChan0=0;
> > > > > > ch0->InputChan1=0;
> > > > > > ch0->OutputChan0=8;
> > > > > > ch0->OutputChan1=0;
> > > > > > ch0->MasterAxis=-1;
> > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > ch0->InputGain0=1;
> > > > > > ch0->InputGain1=1;
> > > > > > ch0->InputOffset0=0;
> > > > > > ch0->InputOffset1=0;
> > > > > > ch0->OutputGain=1;
> > > > > > ch0->OutputOffset=0;
> > > > > > ch0->SlaveGain=1;
> > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > ch0->BacklashAmount=0;
> > > > > > ch0->BacklashRate=0;
> > > > > > ch0->invDistPerCycle=1;
> > > > > > ch0->Lead=0;
> > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > ch0->StepperAmplitude=20;
> > > > > >
> > > > > > ch0->iir[0].B0=1;
> > > > > > ch0->iir[0].B1=0;
> > > > > > ch0->iir[0].B2=0;
> > > > > > ch0->iir[0].A1=0;
> > > > > > ch0->iir[0].A2=0;
> > > > > >
> > > > > > ch0->iir[1].B0=1;
> > > > > > ch0->iir[1].B1=0;
> > > > > > ch0->iir[1].B2=0;
> > > > > > ch0->iir[1].A1=0;
> > > > > > ch0->iir[1].A2=0;
> > > > > >
> > > > > > ch0->iir[2].B0=0.000769;
> > > > > > ch0->iir[2].B1=0.001538;
> > > > > > ch0->iir[2].B2=0.000769;
> > > > > > ch0->iir[2].A1=1.92081;
> > > > > > ch0->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(0,0);
> > > > > >
> > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > ch1->Vel=70000;
> > > > > > ch1->Accel=500000;
> > > > > > ch1->Jerk=4e+006;
> > > > > > ch1->P=0;
> > > > > > ch1->I=0.01;
> > > > > > ch1->D=0;
> > > > > > ch1->FFAccel=0;
> > > > > > ch1->FFVel=0;
> > > > > > ch1->MaxI=200;
> > > > > > ch1->MaxErr=1e+006;
> > > > > > ch1->MaxOutput=200;
> > > > > > ch1->DeadBandGain=1;
> > > > > > ch1->DeadBandRange=0;
> > > > > > ch1->InputChan0=1;
> > > > > > ch1->InputChan1=0;
> > > > > > ch1->OutputChan0=9;
> > > > > > ch1->OutputChan1=0;
> > > > > > ch1->MasterAxis=-1;
> > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > ch1->InputGain0=1;
> > > > > > ch1->InputGain1=1;
> > > > > > ch1->InputOffset0=0;
> > > > > > ch1->InputOffset1=0;
> > > > > > ch1->OutputGain=1;
> > > > > > ch1->OutputOffset=0;
> > > > > > ch1->SlaveGain=1;
> > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > ch1->BacklashAmount=0;
> > > > > > ch1->BacklashRate=0;
> > > > > > ch1->invDistPerCycle=1;
> > > > > > ch1->Lead=0;
> > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > ch1->StepperAmplitude=20;
> > > > > >
> > > > > > ch1->iir[0].B0=1;
> > > > > > ch1->iir[0].B1=0;
> > > > > > ch1->iir[0].B2=0;
> > > > > > ch1->iir[0].A1=0;
> > > > > > ch1->iir[0].A2=0;
> > > > > >
> > > > > > ch1->iir[1].B0=1;
> > > > > > ch1->iir[1].B1=0;
> > > > > > ch1->iir[1].B2=0;
> > > > > > ch1->iir[1].A1=0;
> > > > > > ch1->iir[1].A2=0;
> > > > > >
> > > > > > ch1->iir[2].B0=0.000769;
> > > > > > ch1->iir[2].B1=0.001538;
> > > > > > ch1->iir[2].B2=0.000769;
> > > > > > ch1->iir[2].A1=1.92081;
> > > > > > ch1->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(1,0);
> > > > > >
> > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > ch2->Vel=51000;
> > > > > > ch2->Accel=700000;
> > > > > > ch2->Jerk=4e+006;
> > > > > > ch2->P=0;
> > > > > > ch2->I=0.01;
> > > > > > ch2->D=0;
> > > > > > ch2->FFAccel=0;
> > > > > > ch2->FFVel=0;
> > > > > > ch2->MaxI=200;
> > > > > > ch2->MaxErr=1e+006;
> > > > > > ch2->MaxOutput=200;
> > > > > > ch2->DeadBandGain=1;
> > > > > > ch2->DeadBandRange=0;
> > > > > > ch2->InputChan0=2;
> > > > > > ch2->InputChan1=0;
> > > > > > ch2->OutputChan0=10;
> > > > > > ch2->OutputChan1=0;
> > > > > > ch2->MasterAxis=-1;
> > > > > > ch2->LimitSwitchOptions=0x0;
> > > > > > ch2->InputGain0=1;
> > > > > > ch2->InputGain1=1;
> > > > > > ch2->InputOffset0=0;
> > > > > > ch2->InputOffset1=0;
> > > > > > ch2->OutputGain=1;
> > > > > > ch2->OutputOffset=0;
> > > > > > ch2->SlaveGain=1;
> > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > ch2->BacklashAmount=0;
> > > > > > ch2->BacklashRate=0;
> > > > > > ch2->invDistPerCycle=1;
> > > > > > ch2->Lead=0;
> > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > ch2->StepperAmplitude=20;
> > > > > >
> > > > > > ch2->iir[0].B0=1;
> > > > > > ch2->iir[0].B1=0;
> > > > > > ch2->iir[0].B2=0;
> > > > > > ch2->iir[0].A1=0;
> > > > > > ch2->iir[0].A2=0;
> > > > > >
> > > > > > ch2->iir[1].B0=1;
> > > > > > ch2->iir[1].B1=0;
> > > > > > ch2->iir[1].B2=0;
> > > > > > ch2->iir[1].A1=0;
> > > > > > ch2->iir[1].A2=0;
> > > > > >
> > > > > > ch2->iir[2].B0=0.000769;
> > > > > > ch2->iir[2].B1=0.001538;
> > > > > > ch2->iir[2].B2=0.000769;
> > > > > > ch2->iir[2].A1=1.92081;
> > > > > > ch2->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(2,0);
> > > > > >
> > > > > > ch3->InputMode=NO_INPUT_MODE;
> > > > > > ch3->OutputMode=STEP_DIR_MODE;
> > > > > > ch3->Vel=80000;
> > > > > > ch3->Accel=40000;
> > > > > > ch3->Jerk=400000;
> > > > > > ch3->P=1;
> > > > > > ch3->I=0;
> > > > > > ch3->D=0;
> > > > > > ch3->FFAccel=0;
> > > > > > ch3->FFVel=0;
> > > > > > ch3->MaxI=200;
> > > > > > ch3->MaxErr=1e+006;
> > > > > > ch3->MaxOutput=200;
> > > > > > ch3->DeadBandGain=1;
> > > > > > ch3->DeadBandRange=0;
> > > > > > ch3->InputChan0=3;
> > > > > > ch3->InputChan1=3;
> > > > > > ch3->OutputChan0=11;
> > > > > > ch3->OutputChan1=7;
> > > > > > ch3->MasterAxis=-1;
> > > > > > ch3->LimitSwitchOptions=0x0;
> > > > > > ch3->InputGain0=1;
> > > > > > ch3->InputGain1=1;
> > > > > > ch3->InputOffset0=0;
> > > > > > ch3->InputOffset1=0;
> > > > > > ch3->OutputGain=1;
> > > > > > ch3->OutputOffset=0;
> > > > > > ch3->SlaveGain=1;
> > > > > > ch3->BacklashMode=BACKLASH_OFF;
> > > > > > ch3->BacklashAmount=0;
> > > > > > ch3->BacklashRate=0;
> > > > > > ch3->invDistPerCycle=1;
> > > > > > ch3->Lead=0;
> > > > > > ch3->MaxFollowingError=1000000000;
> > > > > > ch3->StepperAmplitude=20;
> > > > > >
> > > > > > ch3->iir[0].B0=1;
> > > > > > ch3->iir[0].B1=0;
> > > > > > ch3->iir[0].B2=0;
> > > > > > ch3->iir[0].A1=0;
> > > > > > ch3->iir[0].A2=0;
> > > > > >
> > > > > > ch3->iir[1].B0=1;
> > > > > > ch3->iir[1].B1=0;
> > > > > > ch3->iir[1].B2=0;
> > > > > > ch3->iir[1].A1=0;
> > > > > > ch3->iir[1].A2=0;
> > > > > >
> > > > > > ch3->iir[2].B0=1;
> > > > > > ch3->iir[2].B1=0;
> > > > > > ch3->iir[2].B2=0;
> > > > > > ch3->iir[2].A1=0;
> > > > > > ch3->iir[2].A2=0;
> > > > > >
> > > > > > EnableAxisDest(3,0);
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,3);
> > > > > >
> > > > > > // Configure Enable bit as output, and clear it
> > > > > > SetBitDirection(ENABLE, 1);
> > > > > > //ClearBit(ENABLE);
> > > > > >
> > > > > > // Configure Spindle Control pins as outputs, and clear them
> > > > > > SetBitDirection(SPINDLE_CW, 1);
> > > > > > ClearBit(SPINDLE_CW);
> > > > > > SetBitDirection(SPINDLE_CCW, 1);
> > > > > > ClearBit(SPINDLE_CCW);
> > > > > > // Zero the spindle PWM output
> > > > > > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > > > > > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > > > > > FPGA(IO_PWMS+1) = 1; // Enable
> > > > > >
> > > > > > // Configure Coolant Control pins as outputs, and clear them
> > > > > > SetBitDirection(COOLANT_MIST, 1);
> > > > > > ClearBit(COOLANT_MIST);
> > > > > > SetBitDirection(COOLANT_FLOOD, 1);
> > > > > > ClearBit(COOLANT_FLOOD);
> > > > > >
> > > > > > // Configure Probe pin as input
> > > > > > SetBitDirection(PROBE, 0);
> > > > > >
> > > > > > // Configire E-Stop pin as input
> > > > > > SetBitDirection(ESTOP, 0);
> > > > > >
> > > > > > // Configure Home/Limit pin as input
> > > > > > SetBitDirection(HOME_LIMIT, 0);
> > > > > >
> > > > > > }
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi Ray,
> > > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Only the programs that have been told to execute will be running.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàI assumed you created and configured an Init.c program with the MPG code.ÃÆ'ââ¬Å¡ÃâàThat is a reqirement before you even try to run Mach3.ÃÆ'ââ¬Å¡ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃÆ'ââ¬Å¡ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Maybe you could postÃÆ'ââ¬Å¡Ãâàthe Init.c file you areÃÆ'ââ¬Å¡Ãâàconfigured to use.
> > > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > >
> > > > > > > From: himykabibble <jagboy@>
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, November 3, 2011 5:54 PM
> > > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Tom,
> > > > > > >
> > > > > > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > > > > > >
> > > > > > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > > > > > >
> > > > > > > Regards,
> > > > > > > Ray L.
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi Ray,
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Sounds like you have noise problems.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Regarding the "runaway":ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the
> > > encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> > > > > 100KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > > > > > that basically make no physical sense which confuse the
> > > > > > > algorithm and causes a runaway
> > > > > > > > (It assumes the signals are aliasing at a high speed).
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > >
> > > > > > > >
> > > > > > > > From: himykabibble <jagboy@>
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > > > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > > > > > >
> > > > > > > > Where to look?
> > > > > > > >
> > > > > > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Ray L.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > You can disable the "trick" by changing the line:
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > > > > > to
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > > > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Please give this a try to see if it stops any runaways.
> > > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2133 |
From: himykabibble |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
BTW - I'm running Mach3 v3.43.050, which is an un-released development build, to track down some Mach3/SS bugs. It is, for all practical purposes, the same as your v36, with just some extra data logging added. It has been working perfectly on my machine for several weeks now (with the exception of the one bug in offset handling we're trying to isolate). I'm using KMotion v426.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Tom,
>
> Obviously, my experience with the SmoothStepper is hurting me here. The SS duplicates PP I/O, so you can have a single configuration that will work with the SS or the PP, just by swapping the cables.
>
> So, I've disabled virtually all I/O, except the four axes and the Enable - no spindle, no MPGs, no Modbus, no macropump, no limits, no homes, etc. Using 1024.set (oddly, the keyboard jog keys do not work....). The Y axis/E-Stop problem is gone, which makes sense. The jog runaway is still there. What seems to trigger it is hitting a jog key while it's coasting down from a previous jog. This is easiest to trigger on the A axis, since it has low acceleration. Hold down the on-screen 4+ key (on the jog flyout) for about 2 seconds, then release it and hit the 4- key. The axis should just keep moving. It's 100% repeatable here.
>
> I've updated the XML in the Zip file to reflect these changes.
>
> On the Destinations - the correct behavior, IMHO, is to leave the axis positions alone, except on power-up it should restore the positions it had at shut-down. That is how Mach3 behaves with the PP and SS. The motor init code was cut/pasted straight from KMotion.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > Â
> > So far I haven't been able to get it to runaway. I do see the problem with EStop when I jog Y. This is because the Mach3 EStop Input is configured as IO bit 10 which is the Y Step Output. Change it to something unused. I changed it to IO 46 which is one of the KFLOP LEDs.
> > Â
> > The Init.c program is setting all the Destinations to zero by using the calls of:
> > Â
> > Â EnableAxisDest(0,0);
> > Â EnableAxisDest(1,0);
> > Â EnableAxisDest(2,0);
> > Â EnableAxisDest(3,0);
> > Â
> > This is why all the Mach3 DROs are cleared after a RESET. If you want to do something else we can change the Init.c program to do so.
> > Â
> > I see a lot of IO configured in Mach3 which is unnecessary. All the Step/Dir ,Spindle Outputs will be controlled by KFLOP so there is no need to configure them in Mach3.  Mach3 Outputs #1 and #2 are configured as IO 14 and 16. Bit 14 conficts with KFLOP axis A Step Output. Outputs #5 and #6 are set to port 2 which is also used by KFLOP for IO 128-255. Disable all these or set all these as port 0 to effectively disable them.
> > Â
> > I don't have the screen set you are using. Can you just use the standard 1024.set until we get you running?
> > Â
> > You have a MacroPump enabled but didn't send me the Macropump code. Let's disable it until things are sorted out.
> > Â
> > Could you send me your Spindle C program so I have it.Â
> > Â
> > ModBus support is enabled. Let's disable it.
> > Â
> > MPG #1 is configured in Mach3 let's disable it.
> > Â
> > Mach3 Port #2 is enabled let's disable it.
> > Â
> > I'm using Mach3 Version 3.42.36 what version are you using?
> > Â
> > I'm using KMotion V4.27
> > Â
> > What exactly do you do to get it to run away?
> > Â
> > Thanks
> > TK
> > Â
> > Â
> > Â
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 4, 2011 8:34 PM
> > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> >
> >
> > Â
> > KMotion seems to work OK - no runaway. If I start KMotion, then start Mach3, then jog until the runaway occurs, the motion is reflected in KMotion. If I then do a Disable Axis, Set the Dest for the axis to just beyond where it is, then EnableAxis, it starts right up again. If I first kill Mach3, then it does not start again no the EnableAxis, so it appears Mach3 is somehow commanding to move to somewhere on another planet.
> >
> > I'm stumped. I'll post my init and XML in the Files area, as RayLsFiles.zip.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > >
> > > Tom,
> > >
> > > Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > > ÃÂ
> > > > That is strange.ÃÂ The only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> > > > ÃÂ
> > > > Can you give more clues like how often it happens, whether it does it when jogging cont. or steps?ÃÂ How is the runaway motion constant speed?ÃÂ Your system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> > > > ÃÂ
> > > > If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> > > > ÃÂ
> > > > Thanks
> > > > TK
> > > > ÃÂ
> > > > ÃÂ
> > > > ÃÂ
> > > >
> > > >
> > > > ________________________________
> > > > From: himykabibble <jagboy@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 3, 2011 7:54 PM
> > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > >
> > > >
> > > > ÃÂ
> > > > Tom,
> > > >
> > > > Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > > ÃâÃÂ
> > > > > You are correct there isn't any loop.ÃâàI headed off in the totally wrong direction.
> > > > > ÃâÃÂ
> > > > > I don't know what it could be.ÃâàHow were you jogging then anyway?ÃâàWith the keyboard?ÃâàDidn't you say you had a modbus MPG?ÃâàPoKeys?ÃâàDo you have any external events defined in Mach3?
> > > > > ÃâÃÂ
> > > > > Regards
> > > > > TK
> > > > >
> > > > > From: himykabibble <jagboy@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 3, 2011 6:58 PM
> > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > >
> > > > >
> > > > > ÃâÃÂ
> > > > > Tom,
> > > > >
> > > > > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> > > > >
> > > > > #include "KMotionDef.h"
> > > > > #include "MyCommonDefs.h"
> > > > >
> > > > > main()
> > > > > {
> > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > ch0->Vel=70000;
> > > > > ch0->Accel=500000;
> > > > > ch0->Jerk=4e+006;
> > > > > ch0->P=0;
> > > > > ch0->I=0.01;
> > > > > ch0->D=0;
> > > > > ch0->FFAccel=0;
> > > > > ch0->FFVel=0;
> > > > > ch0->MaxI=200;
> > > > > ch0->MaxErr=1e+006;
> > > > > ch0->MaxOutput=200;
> > > > > ch0->DeadBandGain=1;
> > > > > ch0->DeadBandRange=0;
> > > > > ch0->InputChan0=0;
> > > > > ch0->InputChan1=0;
> > > > > ch0->OutputChan0=8;
> > > > > ch0->OutputChan1=0;
> > > > > ch0->MasterAxis=-1;
> > > > > ch0->LimitSwitchOptions=0x0;
> > > > > ch0->InputGain0=1;
> > > > > ch0->InputGain1=1;
> > > > > ch0->InputOffset0=0;
> > > > > ch0->InputOffset1=0;
> > > > > ch0->OutputGain=1;
> > > > > ch0->OutputOffset=0;
> > > > > ch0->SlaveGain=1;
> > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > ch0->BacklashAmount=0;
> > > > > ch0->BacklashRate=0;
> > > > > ch0->invDistPerCycle=1;
> > > > > ch0->Lead=0;
> > > > > ch0->MaxFollowingError=1000000000;
> > > > > ch0->StepperAmplitude=20;
> > > > >
> > > > > ch0->iir[0].B0=1;
> > > > > ch0->iir[0].B1=0;
> > > > > ch0->iir[0].B2=0;
> > > > > ch0->iir[0].A1=0;
> > > > > ch0->iir[0].A2=0;
> > > > >
> > > > > ch0->iir[1].B0=1;
> > > > > ch0->iir[1].B1=0;
> > > > > ch0->iir[1].B2=0;
> > > > > ch0->iir[1].A1=0;
> > > > > ch0->iir[1].A2=0;
> > > > >
> > > > > ch0->iir[2].B0=0.000769;
> > > > > ch0->iir[2].B1=0.001538;
> > > > > ch0->iir[2].B2=0.000769;
> > > > > ch0->iir[2].A1=1.92081;
> > > > > ch0->iir[2].A2=-0.923885;
> > > > >
> > > > > EnableAxisDest(0,0);
> > > > >
> > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > ch1->Vel=70000;
> > > > > ch1->Accel=500000;
> > > > > ch1->Jerk=4e+006;
> > > > > ch1->P=0;
> > > > > ch1->I=0.01;
> > > > > ch1->D=0;
> > > > > ch1->FFAccel=0;
> > > > > ch1->FFVel=0;
> > > > > ch1->MaxI=200;
> > > > > ch1->MaxErr=1e+006;
> > > > > ch1->MaxOutput=200;
> > > > > ch1->DeadBandGain=1;
> > > > > ch1->DeadBandRange=0;
> > > > > ch1->InputChan0=1;
> > > > > ch1->InputChan1=0;
> > > > > ch1->OutputChan0=9;
> > > > > ch1->OutputChan1=0;
> > > > > ch1->MasterAxis=-1;
> > > > > ch1->LimitSwitchOptions=0x0;
> > > > > ch1->InputGain0=1;
> > > > > ch1->InputGain1=1;
> > > > > ch1->InputOffset0=0;
> > > > > ch1->InputOffset1=0;
> > > > > ch1->OutputGain=1;
> > > > > ch1->OutputOffset=0;
> > > > > ch1->SlaveGain=1;
> > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > ch1->BacklashAmount=0;
> > > > > ch1->BacklashRate=0;
> > > > > ch1->invDistPerCycle=1;
> > > > > ch1->Lead=0;
> > > > > ch1->MaxFollowingError=1000000000;
> > > > > ch1->StepperAmplitude=20;
> > > > >
> > > > > ch1->iir[0].B0=1;
> > > > > ch1->iir[0].B1=0;
> > > > > ch1->iir[0].B2=0;
> > > > > ch1->iir[0].A1=0;
> > > > > ch1->iir[0].A2=0;
> > > > >
> > > > > ch1->iir[1].B0=1;
> > > > > ch1->iir[1].B1=0;
> > > > > ch1->iir[1].B2=0;
> > > > > ch1->iir[1].A1=0;
> > > > > ch1->iir[1].A2=0;
> > > > >
> > > > > ch1->iir[2].B0=0.000769;
> > > > > ch1->iir[2].B1=0.001538;
> > > > > ch1->iir[2].B2=0.000769;
> > > > > ch1->iir[2].A1=1.92081;
> > > > > ch1->iir[2].A2=-0.923885;
> > > > >
> > > > > EnableAxisDest(1,0);
> > > > >
> > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > ch2->Vel=51000;
> > > > > ch2->Accel=700000;
> > > > > ch2->Jerk=4e+006;
> > > > > ch2->P=0;
> > > > > ch2->I=0.01;
> > > > > ch2->D=0;
> > > > > ch2->FFAccel=0;
> > > > > ch2->FFVel=0;
> > > > > ch2->MaxI=200;
> > > > > ch2->MaxErr=1e+006;
> > > > > ch2->MaxOutput=200;
> > > > > ch2->DeadBandGain=1;
> > > > > ch2->DeadBandRange=0;
> > > > > ch2->InputChan0=2;
> > > > > ch2->InputChan1=0;
> > > > > ch2->OutputChan0=10;
> > > > > ch2->OutputChan1=0;
> > > > > ch2->MasterAxis=-1;
> > > > > ch2->LimitSwitchOptions=0x0;
> > > > > ch2->InputGain0=1;
> > > > > ch2->InputGain1=1;
> > > > > ch2->InputOffset0=0;
> > > > > ch2->InputOffset1=0;
> > > > > ch2->OutputGain=1;
> > > > > ch2->OutputOffset=0;
> > > > > ch2->SlaveGain=1;
> > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > ch2->BacklashAmount=0;
> > > > > ch2->BacklashRate=0;
> > > > > ch2->invDistPerCycle=1;
> > > > > ch2->Lead=0;
> > > > > ch2->MaxFollowingError=1000000000;
> > > > > ch2->StepperAmplitude=20;
> > > > >
> > > > > ch2->iir[0].B0=1;
> > > > > ch2->iir[0].B1=0;
> > > > > ch2->iir[0].B2=0;
> > > > > ch2->iir[0].A1=0;
> > > > > ch2->iir[0].A2=0;
> > > > >
> > > > > ch2->iir[1].B0=1;
> > > > > ch2->iir[1].B1=0;
> > > > > ch2->iir[1].B2=0;
> > > > > ch2->iir[1].A1=0;
> > > > > ch2->iir[1].A2=0;
> > > > >
> > > > > ch2->iir[2].B0=0.000769;
> > > > > ch2->iir[2].B1=0.001538;
> > > > > ch2->iir[2].B2=0.000769;
> > > > > ch2->iir[2].A1=1.92081;
> > > > > ch2->iir[2].A2=-0.923885;
> > > > >
> > > > > EnableAxisDest(2,0);
> > > > >
> > > > > ch3->InputMode=NO_INPUT_MODE;
> > > > > ch3->OutputMode=STEP_DIR_MODE;
> > > > > ch3->Vel=80000;
> > > > > ch3->Accel=40000;
> > > > > ch3->Jerk=400000;
> > > > > ch3->P=1;
> > > > > ch3->I=0;
> > > > > ch3->D=0;
> > > > > ch3->FFAccel=0;
> > > > > ch3->FFVel=0;
> > > > > ch3->MaxI=200;
> > > > > ch3->MaxErr=1e+006;
> > > > > ch3->MaxOutput=200;
> > > > > ch3->DeadBandGain=1;
> > > > > ch3->DeadBandRange=0;
> > > > > ch3->InputChan0=3;
> > > > > ch3->InputChan1=3;
> > > > > ch3->OutputChan0=11;
> > > > > ch3->OutputChan1=7;
> > > > > ch3->MasterAxis=-1;
> > > > > ch3->LimitSwitchOptions=0x0;
> > > > > ch3->InputGain0=1;
> > > > > ch3->InputGain1=1;
> > > > > ch3->InputOffset0=0;
> > > > > ch3->InputOffset1=0;
> > > > > ch3->OutputGain=1;
> > > > > ch3->OutputOffset=0;
> > > > > ch3->SlaveGain=1;
> > > > > ch3->BacklashMode=BACKLASH_OFF;
> > > > > ch3->BacklashAmount=0;
> > > > > ch3->BacklashRate=0;
> > > > > ch3->invDistPerCycle=1;
> > > > > ch3->Lead=0;
> > > > > ch3->MaxFollowingError=1000000000;
> > > > > ch3->StepperAmplitude=20;
> > > > >
> > > > > ch3->iir[0].B0=1;
> > > > > ch3->iir[0].B1=0;
> > > > > ch3->iir[0].B2=0;
> > > > > ch3->iir[0].A1=0;
> > > > > ch3->iir[0].A2=0;
> > > > >
> > > > > ch3->iir[1].B0=1;
> > > > > ch3->iir[1].B1=0;
> > > > > ch3->iir[1].B2=0;
> > > > > ch3->iir[1].A1=0;
> > > > > ch3->iir[1].A2=0;
> > > > >
> > > > > ch3->iir[2].B0=1;
> > > > > ch3->iir[2].B1=0;
> > > > > ch3->iir[2].B2=0;
> > > > > ch3->iir[2].A1=0;
> > > > > ch3->iir[2].A2=0;
> > > > >
> > > > > EnableAxisDest(3,0);
> > > > >
> > > > > DefineCoordSystem(0,1,2,3);
> > > > >
> > > > > // Configure Enable bit as output, and clear it
> > > > > SetBitDirection(ENABLE, 1);
> > > > > //ClearBit(ENABLE);
> > > > >
> > > > > // Configure Spindle Control pins as outputs, and clear them
> > > > > SetBitDirection(SPINDLE_CW, 1);
> > > > > ClearBit(SPINDLE_CW);
> > > > > SetBitDirection(SPINDLE_CCW, 1);
> > > > > ClearBit(SPINDLE_CCW);
> > > > > // Zero the spindle PWM output
> > > > > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > > > > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > > > > FPGA(IO_PWMS+1) = 1; // Enable
> > > > >
> > > > > // Configure Coolant Control pins as outputs, and clear them
> > > > > SetBitDirection(COOLANT_MIST, 1);
> > > > > ClearBit(COOLANT_MIST);
> > > > > SetBitDirection(COOLANT_FLOOD, 1);
> > > > > ClearBit(COOLANT_FLOOD);
> > > > >
> > > > > // Configure Probe pin as input
> > > > > SetBitDirection(PROBE, 0);
> > > > >
> > > > > // Configire E-Stop pin as input
> > > > > SetBitDirection(ESTOP, 0);
> > > > >
> > > > > // Configure Home/Limit pin as input
> > > > > SetBitDirection(HOME_LIMIT, 0);
> > > > >
> > > > > }
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi Ray,
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Only the programs that have been told to execute will be running.ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàI assumed you created and configured an Init.c program with the MPG code.ÃÆ'ââ¬Å¡ÃâàThat is a reqirement before you even try to run Mach3.ÃÆ'ââ¬Å¡ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃÆ'ââ¬Å¡ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Maybe you could postÃÆ'ââ¬Å¡Ãâàthe Init.c file you areÃÆ'ââ¬Å¡Ãâàconfigured to use.
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Regards
> > > > > > TK
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > >
> > > > > > From: himykabibble <jagboy@>
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, November 3, 2011 5:54 PM
> > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > >
> > > > > >
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Tom,
> > > > > >
> > > > > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > > > > >
> > > > > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi Ray,
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Sounds like you have noise problems.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Regarding the "runaway":ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr encoder.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the
> > encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> > > > 100KHz.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > > > > that basically make no physical sense which confuse the
> > > > > > algorithm and causes a runaway
> > > > > > > (It assumes the signals are aliasing at a high speed).
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > >
> > > > > > >
> > > > > > > From: himykabibble <jagboy@>
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > > > > >
> > > > > > > Where to look?
> > > > > > >
> > > > > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > > > > >
> > > > > > > Regards,
> > > > > > > Ray L.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > You can disable the "trick" by changing the line:
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > > > > to
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Please give this a try to see if it stops any runaways.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Regards
> > > > > > > TK
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2134 |
From: Tom Kerekes |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
I observe the runaway problem with Mach3 V3.43.050 but not V3.42.36 so they must have changed something. Did you try that exact version with the parallel port?
I see the problem with the keyboard jog keys. Mach3 needs to have the enables for the axes on the Config | Ports&Pins | Motor Outputs set to Enable. Otherwise Mach3 "Inhibits" the axis. Enable the axes you are using but set the Ports to 0 so they don't conflict with anything. I see you have them already all set to port0 except it looks like you missed one.
If you wish to change the Init.c program to not clear the Destination you can change the Enable Axis call to set the Destination to the existing Destination by:
EnableAxisDest(0,ch0->Dest);
EnableAxisDest(1,ch1->Dest);
EnableAxisDest(2,ch2->Dest);
EnableAxisDest(3,ch3->Dest);
Thanks
TK
Group: DynoMotion |
Message: 2135 |
From: Tom Kerekes |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Hi Ray,
I see the Mach3 Change log has this comment for V3.43.50 which I have no idea what it means but sounds suspicious:
-- Jogging test taken out to cut back on Motion device taffic
I don't see a way to download previous development versions.
Regards
TK
Group: DynoMotion |
Message: 2136 |
From: himykabibble |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
Tom,
I was not aware that Brian had removed that - that was something he added in about v47 to inhibit jogging if the Mach3 window lost focus, specifically to prevent runaways on jogging if a jog was started, then the window lost focus. Funny thing is, I don't see this problem on my machine, which is running v50, and I've used it a LOT over the last few weeks. I'll report the problem to Brian, and revert to an older version before this change was made (and then un-made). I'm sure I can get any old dev version if necessary, and I have a whole bunch of them on my laptop, since I get versions from Brian several times a week lately. Unfortunately, I can't run my machine on the PP at the moment, though I'm not sure why. Last time I tried, about two weeks ago, I couldn't even get it out of E-Stop. Last time I even tried before that was almost 3 years ago, and a whole lot has changed since then, so it's not too surprising.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> I see the Mach3 Change log has this comment for V3.43.50 which I have no idea what it means but sounds suspicious:
> Â
> Â Â Â -- Jogging test taken out to cut back on Motion device taffic
> Â
> I don't see a way to download previous development versions.
> Â
> Regards
> TK
>
> From: Tom Kerekes <tk@...>
> To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
> Sent: Saturday, November 5, 2011 12:32 PM
> Subject: Re: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Hi Ray,
> Â
> I observe the runaway problem with Mach3 V3.43.050 but not V3.42.36 so they must have changed something. Did you try that exact version with the parallel port?
> Â
> I see the problem with the keyboard jog keys. Mach3 needs to have the enables for the axes on the Config | Ports&Pins | Motor Outputs set to Enable. Otherwise Mach3 "Inhibits" the axis. Enable the axes you are using but set the Ports to 0 so they don't conflict with anything. I see you have them already all set to port0 except it looks like you missed one.
> Â
> If you wish to change the Init.c program to not clear the Destination you can change the Enable Axis call to set the Destination to the existing Destination by:
>
> EnableAxisDest(0,ch0->Dest);
> EnableAxisDest(1,ch1->Dest);
> EnableAxisDest(2,ch2->Dest);
> EnableAxisDest(3,ch3->Dest);
> Thanks
> TK
>
>
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Saturday, November 5, 2011 11:47 AM
> Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Â
> Tom,
>
> BTW - I'm running Mach3 v3.43.050, which is an un-released development build, to track down some Mach3/SS bugs. It is, for all practical purposes, the same as your v36, with just some extra data logging added. It has been working perfectly on my machine for several weeks now (with the exception of the one bug in offset handling we're trying to isolate). I'm using KMotion v426.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Tom,
> >
> > Obviously, my experience with the SmoothStepper is hurting me here. The SS duplicates PP I/O, so you can have a single configuration that will work with the SS or the PP, just by swapping the cables.
> >
> > So, I've disabled virtually all I/O, except the four axes and the Enable - no spindle, no MPGs, no Modbus, no macropump, no limits, no homes, etc. Using 1024.set (oddly, the keyboard jog keys do not work....). The Y axis/E-Stop problem is gone, which makes sense. The jog runaway is still there. What seems to trigger it is hitting a jog key while it's coasting down from a previous jog. This is easiest to trigger on the A axis, since it has low acceleration. Hold down the on-screen 4+ key (on the jog flyout) for about 2 seconds, then release it and hit the 4- key. The axis should just keep moving. It's 100% repeatable here.
> >
> > I've updated the XML in the Zip file to reflect these changes.
> >
> > On the Destinations - the correct behavior, IMHO, is to leave the axis positions alone, except on power-up it should restore the positions it had at shut-down. That is how Mach3 behaves with the PP and SS. The motor init code was cut/pasted straight from KMotion.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃÂ
> > > So far I haven't been able to get it to runaway.ÃÂ I do see the problem with EStop when I jog Y.ÃÂ This is because the Mach3 EStop Input is configured as IO bit 10 which is the Y Step Output.ÃÂ Change it to something unused.ÃÂ I changed it to IO 46 which is one of the KFLOP LEDs.
> > > ÃÂ
> > > The Init.c program is setting all the Destinations to zero by using the calls of:
> > > ÃÂ
> > > ÃÂ EnableAxisDest(0,0);
> > > ÃÂ EnableAxisDest(1,0);
> > > ÃÂ EnableAxisDest(2,0);
> > > ÃÂ EnableAxisDest(3,0);
> > > ÃÂ
> > > This is why all the Mach3 DROs are cleared after a RESET.ÃÂ If you want to do something else we can change the Init.c program to do so.
> > > ÃÂ
> > > I see a lot of IO configured in Mach3 which is unnecessary.ÃÂ All the Step/Dir ,Spindle Outputs will be controlled by KFLOP so there is no need to configure them in Mach3.ÃÂ ÃÂ Mach3 Outputs #1 and #2 are configured as IO 14 and 16.ÃÂ Bit 14 conficts with KFLOP axis A Step Output.ÃÂ Outputs #5ÃÂ andÃÂ #6 are set to port 2 which is also used by KFLOP for IO 128-255.ÃÂ Disable all these or set all these as port 0 to effectively disable them.
> > > ÃÂ
> > > I don't have the screen set you are using.ÃÂ Can you just use the standard 1024.set until we get you running?
> > > ÃÂ
> > > You have a MacroPump enabled but didn't send me the Macropump code.ÃÂ Let's disable it until things are sorted out.
> > > ÃÂ
> > > Could you send me your Spindle C program so I have it.ÃÂ
> > > ÃÂ
> > > ModBus support is enabled.ÃÂ Let's disable it.
> > > ÃÂ
> > > MPG #1 is configured in Mach3 let's disable it.
> > > ÃÂ
> > > Mach3 Port #2 is enabled let's disable it.
> > > ÃÂ
> > > I'm using Mach3 Version 3.42.36 what version are you using?
> > > ÃÂ
> > > I'm using KMotion V4.27
> > > ÃÂ
> > > What exactly do you do to get it to run away?
> > > ÃÂ
> > > Thanks
> > > TK
> > > ÃÂ
> > > ÃÂ
> > > ÃÂ
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Friday, November 4, 2011 8:34 PM
> > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > >
> > >
> > > ÃÂ
> > > KMotion seems to work OK - no runaway. If I start KMotion, then start Mach3, then jog until the runaway occurs, the motion is reflected in KMotion. If I then do a Disable Axis, Set the Dest for the axis to just beyond where it is, then EnableAxis, it starts right up again. If I first kill Mach3, then it does not start again no the EnableAxis, so it appears Mach3 is somehow commanding to move to somewhere on another planet.
> > >
> > > I'm stumped. I'll post my init and XML in the Files area, as RayLsFiles.zip.
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > >
> > > > Tom,
> > > >
> > > > Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > > ÃâÃÂ
> > > > > That is strange.ÃâàThe only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> > > > > ÃâÃÂ
> > > > > Can you give more clues like how often it happens, whether it does it when jogging cont. or steps?ÃâàHow is the runaway motion constant speed?ÃâàYour system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> > > > > ÃâÃÂ
> > > > > If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> > > > > ÃâÃÂ
> > > > > Thanks
> > > > > TK
> > > > > ÃâÃÂ
> > > > > ÃâÃÂ
> > > > > ÃâÃÂ
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: himykabibble <jagboy@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 3, 2011 7:54 PM
> > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > >
> > > > >
> > > > > ÃâÃÂ
> > > > > Tom,
> > > > >
> > > > > Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi Ray,
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > You are correct there isn't any loop.ÃÆ'ââ¬Å¡ÃâàI headed off in the totally wrong direction.
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > I don't know what it could be.ÃÆ'ââ¬Å¡ÃâàHow were you jogging then anyway?ÃÆ'ââ¬Å¡ÃâàWith the keyboard?ÃÆ'ââ¬Å¡ÃâàDidn't you say you had a modbus MPG?ÃÆ'ââ¬Å¡ÃâàPoKeys?ÃÆ'ââ¬Å¡ÃâàDo you have any external events defined in Mach3?
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > > From: himykabibble <jagboy@>
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, November 3, 2011 6:58 PM
> > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > >
> > > > > >
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Tom,
> > > > > >
> > > > > > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > > #include "MyCommonDefs.h"
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > ch0->Vel=70000;
> > > > > > ch0->Accel=500000;
> > > > > > ch0->Jerk=4e+006;
> > > > > > ch0->P=0;
> > > > > > ch0->I=0.01;
> > > > > > ch0->D=0;
> > > > > > ch0->FFAccel=0;
> > > > > > ch0->FFVel=0;
> > > > > > ch0->MaxI=200;
> > > > > > ch0->MaxErr=1e+006;
> > > > > > ch0->MaxOutput=200;
> > > > > > ch0->DeadBandGain=1;
> > > > > > ch0->DeadBandRange=0;
> > > > > > ch0->InputChan0=0;
> > > > > > ch0->InputChan1=0;
> > > > > > ch0->OutputChan0=8;
> > > > > > ch0->OutputChan1=0;
> > > > > > ch0->MasterAxis=-1;
> > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > ch0->InputGain0=1;
> > > > > > ch0->InputGain1=1;
> > > > > > ch0->InputOffset0=0;
> > > > > > ch0->InputOffset1=0;
> > > > > > ch0->OutputGain=1;
> > > > > > ch0->OutputOffset=0;
> > > > > > ch0->SlaveGain=1;
> > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > ch0->BacklashAmount=0;
> > > > > > ch0->BacklashRate=0;
> > > > > > ch0->invDistPerCycle=1;
> > > > > > ch0->Lead=0;
> > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > ch0->StepperAmplitude=20;
> > > > > >
> > > > > > ch0->iir[0].B0=1;
> > > > > > ch0->iir[0].B1=0;
> > > > > > ch0->iir[0].B2=0;
> > > > > > ch0->iir[0].A1=0;
> > > > > > ch0->iir[0].A2=0;
> > > > > >
> > > > > > ch0->iir[1].B0=1;
> > > > > > ch0->iir[1].B1=0;
> > > > > > ch0->iir[1].B2=0;
> > > > > > ch0->iir[1].A1=0;
> > > > > > ch0->iir[1].A2=0;
> > > > > >
> > > > > > ch0->iir[2].B0=0.000769;
> > > > > > ch0->iir[2].B1=0.001538;
> > > > > > ch0->iir[2].B2=0.000769;
> > > > > > ch0->iir[2].A1=1.92081;
> > > > > > ch0->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(0,0);
> > > > > >
> > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > ch1->Vel=70000;
> > > > > > ch1->Accel=500000;
> > > > > > ch1->Jerk=4e+006;
> > > > > > ch1->P=0;
> > > > > > ch1->I=0.01;
> > > > > > ch1->D=0;
> > > > > > ch1->FFAccel=0;
> > > > > > ch1->FFVel=0;
> > > > > > ch1->MaxI=200;
> > > > > > ch1->MaxErr=1e+006;
> > > > > > ch1->MaxOutput=200;
> > > > > > ch1->DeadBandGain=1;
> > > > > > ch1->DeadBandRange=0;
> > > > > > ch1->InputChan0=1;
> > > > > > ch1->InputChan1=0;
> > > > > > ch1->OutputChan0=9;
> > > > > > ch1->OutputChan1=0;
> > > > > > ch1->MasterAxis=-1;
> > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > ch1->InputGain0=1;
> > > > > > ch1->InputGain1=1;
> > > > > > ch1->InputOffset0=0;
> > > > > > ch1->InputOffset1=0;
> > > > > > ch1->OutputGain=1;
> > > > > > ch1->OutputOffset=0;
> > > > > > ch1->SlaveGain=1;
> > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > ch1->BacklashAmount=0;
> > > > > > ch1->BacklashRate=0;
> > > > > > ch1->invDistPerCycle=1;
> > > > > > ch1->Lead=0;
> > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > ch1->StepperAmplitude=20;
> > > > > >
> > > > > > ch1->iir[0].B0=1;
> > > > > > ch1->iir[0].B1=0;
> > > > > > ch1->iir[0].B2=0;
> > > > > > ch1->iir[0].A1=0;
> > > > > > ch1->iir[0].A2=0;
> > > > > >
> > > > > > ch1->iir[1].B0=1;
> > > > > > ch1->iir[1].B1=0;
> > > > > > ch1->iir[1].B2=0;
> > > > > > ch1->iir[1].A1=0;
> > > > > > ch1->iir[1].A2=0;
> > > > > >
> > > > > > ch1->iir[2].B0=0.000769;
> > > > > > ch1->iir[2].B1=0.001538;
> > > > > > ch1->iir[2].B2=0.000769;
> > > > > > ch1->iir[2].A1=1.92081;
> > > > > > ch1->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(1,0);
> > > > > >
> > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > ch2->Vel=51000;
> > > > > > ch2->Accel=700000;
> > > > > > ch2->Jerk=4e+006;
> > > > > > ch2->P=0;
> > > > > > ch2->I=0.01;
> > > > > > ch2->D=0;
> > > > > > ch2->FFAccel=0;
> > > > > > ch2->FFVel=0;
> > > > > > ch2->MaxI=200;
> > > > > > ch2->MaxErr=1e+006;
> > > > > > ch2->MaxOutput=200;
> > > > > > ch2->DeadBandGain=1;
> > > > > > ch2->DeadBandRange=0;
> > > > > > ch2->InputChan0=2;
> > > > > > ch2->InputChan1=0;
> > > > > > ch2->OutputChan0=10;
> > > > > > ch2->OutputChan1=0;
> > > > > > ch2->MasterAxis=-1;
> > > > > > ch2->LimitSwitchOptions=0x0;
> > > > > > ch2->InputGain0=1;
> > > > > > ch2->InputGain1=1;
> > > > > > ch2->InputOffset0=0;
> > > > > > ch2->InputOffset1=0;
> > > > > > ch2->OutputGain=1;
> > > > > > ch2->OutputOffset=0;
> > > > > > ch2->SlaveGain=1;
> > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > ch2->BacklashAmount=0;
> > > > > > ch2->BacklashRate=0;
> > > > > > ch2->invDistPerCycle=1;
> > > > > > ch2->Lead=0;
> > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > ch2->StepperAmplitude=20;
> > > > > >
> > > > > > ch2->iir[0].B0=1;
> > > > > > ch2->iir[0].B1=0;
> > > > > > ch2->iir[0].B2=0;
> > > > > > ch2->iir[0].A1=0;
> > > > > > ch2->iir[0].A2=0;
> > > > > >
> > > > > > ch2->iir[1].B0=1;
> > > > > > ch2->iir[1].B1=0;
> > > > > > ch2->iir[1].B2=0;
> > > > > > ch2->iir[1].A1=0;
> > > > > > ch2->iir[1].A2=0;
> > > > > >
> > > > > > ch2->iir[2].B0=0.000769;
> > > > > > ch2->iir[2].B1=0.001538;
> > > > > > ch2->iir[2].B2=0.000769;
> > > > > > ch2->iir[2].A1=1.92081;
> > > > > > ch2->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(2,0);
> > > > > >
> > > > > > ch3->InputMode=NO_INPUT_MODE;
> > > > > > ch3->OutputMode=STEP_DIR_MODE;
> > > > > > ch3->Vel=80000;
> > > > > > ch3->Accel=40000;
> > > > > > ch3->Jerk=400000;
> > > > > > ch3->P=1;
> > > > > > ch3->I=0;
> > > > > > ch3->D=0;
> > > > > > ch3->FFAccel=0;
> > > > > > ch3->FFVel=0;
> > > > > > ch3->MaxI=200;
> > > > > > ch3->MaxErr=1e+006;
> > > > > > ch3->MaxOutput=200;
> > > > > > ch3->DeadBandGain=1;
> > > > > > ch3->DeadBandRange=0;
> > > > > > ch3->InputChan0=3;
> > > > > > ch3->InputChan1=3;
> > > > > > ch3->OutputChan0=11;
> > > > > > ch3->OutputChan1=7;
> > > > > > ch3->MasterAxis=-1;
> > > > > > ch3->LimitSwitchOptions=0x0;
> > > > > > ch3->InputGain0=1;
> > > > > > ch3->InputGain1=1;
> > > > > > ch3->InputOffset0=0;
> > > > > > ch3->InputOffset1=0;
> > > > > > ch3->OutputGain=1;
> > > > > > ch3->OutputOffset=0;
> > > > > > ch3->SlaveGain=1;
> > > > > > ch3->BacklashMode=BACKLASH_OFF;
> > > > > > ch3->BacklashAmount=0;
> > > > > > ch3->BacklashRate=0;
> > > > > > ch3->invDistPerCycle=1;
> > > > > > ch3->Lead=0;
> > > > > > ch3->MaxFollowingError=1000000000;
> > > > > > ch3->StepperAmplitude=20;
> > > > > >
> > > > > > ch3->iir[0].B0=1;
> > > > > > ch3->iir[0].B1=0;
> > > > > > ch3->iir[0].B2=0;
> > > > > > ch3->iir[0].A1=0;
> > > > > > ch3->iir[0].A2=0;
> > > > > >
> > > > > > ch3->iir[1].B0=1;
> > > > > > ch3->iir[1].B1=0;
> > > > > > ch3->iir[1].B2=0;
> > > > > > ch3->iir[1].A1=0;
> > > > > > ch3->iir[1].A2=0;
> > > > > >
> > > > > > ch3->iir[2].B0=1;
> > > > > > ch3->iir[2].B1=0;
> > > > > > ch3->iir[2].B2=0;
> > > > > > ch3->iir[2].A1=0;
> > > > > > ch3->iir[2].A2=0;
> > > > > >
> > > > > > EnableAxisDest(3,0);
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,3);
> > > > > >
> > > > > > // Configure Enable bit as output, and clear it
> > > > > > SetBitDirection(ENABLE, 1);
> > > > > > //ClearBit(ENABLE);
> > > > > >
> > > > > > // Configure Spindle Control pins as outputs, and clear them
> > > > > > SetBitDirection(SPINDLE_CW, 1);
> > > > > > ClearBit(SPINDLE_CW);
> > > > > > SetBitDirection(SPINDLE_CCW, 1);
> > > > > > ClearBit(SPINDLE_CCW);
> > > > > > // Zero the spindle PWM output
> > > > > > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > > > > > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > > > > > FPGA(IO_PWMS+1) = 1; // Enable
> > > > > >
> > > > > > // Configure Coolant Control pins as outputs, and clear them
> > > > > > SetBitDirection(COOLANT_MIST, 1);
> > > > > > ClearBit(COOLANT_MIST);
> > > > > > SetBitDirection(COOLANT_FLOOD, 1);
> > > > > > ClearBit(COOLANT_FLOOD);
> > > > > >
> > > > > > // Configure Probe pin as input
> > > > > > SetBitDirection(PROBE, 0);
> > > > > >
> > > > > > // Configire E-Stop pin as input
> > > > > > SetBitDirection(ESTOP, 0);
> > > > > >
> > > > > > // Configure Home/Limit pin as input
> > > > > > SetBitDirection(HOME_LIMIT, 0);
> > > > > >
> > > > > > }
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi Ray,
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Only the programs that have been told to execute will be running.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàI assumed you created and configured an Init.c program with the MPG code.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat is a reqirement before you even try to run Mach3.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Maybe you could postÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡Ãâàthe Init.c file you areÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡Ãâàconfigured to use.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > >
> > > > > > > From: himykabibble <jagboy@>
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, November 3, 2011 5:54 PM
> > > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Tom,
> > > > > > >
> > > > > > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > > > > > >
> > > > > > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > > > > > >
> > > > > > > Regards,
> > > > > > > Ray L.
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi Ray,
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Sounds like you have noise problems.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Regarding the "runaway":ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr
> encoder.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the
> > > encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> > > > > 100KHz.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > > > > > that basically make no physical sense which confuse the
> > > > > > > algorithm and causes a runaway
> > > > > > > > (It assumes the signals are aliasing at a high speed).
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > >
> > > > > > > >
> > > > > > > > From: himykabibble <jagboy@>
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > > > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > > > > > >
> > > > > > > > Where to look?
> > > > > > > >
> > > > > > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Ray L.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > You can disable the "trick" by changing the line:
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > > > > > to
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > > > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Please give this a try to see if it stops any runaways.
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 2137 |
From: himykabibble |
Date: 11/5/2011 |
Subject: Re: Uh-Oh! Runaway Jogging! |
OK, I just backed up to v44 (the oldest version I have handy) and the runaway appears to be gone. I'll try to make time to try it on my machine tomorrow with that version.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> I see the Mach3 Change log has this comment for V3.43.50 which I have no idea what it means but sounds suspicious:
> Â
> Â Â Â -- Jogging test taken out to cut back on Motion device taffic
> Â
> I don't see a way to download previous development versions.
> Â
> Regards
> TK
>
> From: Tom Kerekes <tk@...>
> To: "DynoMotion@yahoogroups.com" <DynoMotion@yahoogroups.com>
> Sent: Saturday, November 5, 2011 12:32 PM
> Subject: Re: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Hi Ray,
> Â
> I observe the runaway problem with Mach3 V3.43.050 but not V3.42.36 so they must have changed something. Did you try that exact version with the parallel port?
> Â
> I see the problem with the keyboard jog keys. Mach3 needs to have the enables for the axes on the Config | Ports&Pins | Motor Outputs set to Enable. Otherwise Mach3 "Inhibits" the axis. Enable the axes you are using but set the Ports to 0 so they don't conflict with anything. I see you have them already all set to port0 except it looks like you missed one.
> Â
> If you wish to change the Init.c program to not clear the Destination you can change the Enable Axis call to set the Destination to the existing Destination by:
>
> EnableAxisDest(0,ch0->Dest);
> EnableAxisDest(1,ch1->Dest);
> EnableAxisDest(2,ch2->Dest);
> EnableAxisDest(3,ch3->Dest);
> Thanks
> TK
>
>
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Saturday, November 5, 2011 11:47 AM
> Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
>
>
> Â
> Tom,
>
> BTW - I'm running Mach3 v3.43.050, which is an un-released development build, to track down some Mach3/SS bugs. It is, for all practical purposes, the same as your v36, with just some extra data logging added. It has been working perfectly on my machine for several weeks now (with the exception of the one bug in offset handling we're trying to isolate). I'm using KMotion v426.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Tom,
> >
> > Obviously, my experience with the SmoothStepper is hurting me here. The SS duplicates PP I/O, so you can have a single configuration that will work with the SS or the PP, just by swapping the cables.
> >
> > So, I've disabled virtually all I/O, except the four axes and the Enable - no spindle, no MPGs, no Modbus, no macropump, no limits, no homes, etc. Using 1024.set (oddly, the keyboard jog keys do not work....). The Y axis/E-Stop problem is gone, which makes sense. The jog runaway is still there. What seems to trigger it is hitting a jog key while it's coasting down from a previous jog. This is easiest to trigger on the A axis, since it has low acceleration. Hold down the on-screen 4+ key (on the jog flyout) for about 2 seconds, then release it and hit the 4- key. The axis should just keep moving. It's 100% repeatable here.
> >
> > I've updated the XML in the Zip file to reflect these changes.
> >
> > On the Destinations - the correct behavior, IMHO, is to leave the axis positions alone, except on power-up it should restore the positions it had at shut-down. That is how Mach3 behaves with the PP and SS. The motor init code was cut/pasted straight from KMotion.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃÂ
> > > So far I haven't been able to get it to runaway.ÃÂ I do see the problem with EStop when I jog Y.ÃÂ This is because the Mach3 EStop Input is configured as IO bit 10 which is the Y Step Output.ÃÂ Change it to something unused.ÃÂ I changed it to IO 46 which is one of the KFLOP LEDs.
> > > ÃÂ
> > > The Init.c program is setting all the Destinations to zero by using the calls of:
> > > ÃÂ
> > > ÃÂ EnableAxisDest(0,0);
> > > ÃÂ EnableAxisDest(1,0);
> > > ÃÂ EnableAxisDest(2,0);
> > > ÃÂ EnableAxisDest(3,0);
> > > ÃÂ
> > > This is why all the Mach3 DROs are cleared after a RESET.ÃÂ If you want to do something else we can change the Init.c program to do so.
> > > ÃÂ
> > > I see a lot of IO configured in Mach3 which is unnecessary.ÃÂ All the Step/Dir ,Spindle Outputs will be controlled by KFLOP so there is no need to configure them in Mach3.ÃÂ ÃÂ Mach3 Outputs #1 and #2 are configured as IO 14 and 16.ÃÂ Bit 14 conficts with KFLOP axis A Step Output.ÃÂ Outputs #5ÃÂ andÃÂ #6 are set to port 2 which is also used by KFLOP for IO 128-255.ÃÂ Disable all these or set all these as port 0 to effectively disable them.
> > > ÃÂ
> > > I don't have the screen set you are using.ÃÂ Can you just use the standard 1024.set until we get you running?
> > > ÃÂ
> > > You have a MacroPump enabled but didn't send me the Macropump code.ÃÂ Let's disable it until things are sorted out.
> > > ÃÂ
> > > Could you send me your Spindle C program so I have it.ÃÂ
> > > ÃÂ
> > > ModBus support is enabled.ÃÂ Let's disable it.
> > > ÃÂ
> > > MPG #1 is configured in Mach3 let's disable it.
> > > ÃÂ
> > > Mach3 Port #2 is enabled let's disable it.
> > > ÃÂ
> > > I'm using Mach3 Version 3.42.36 what version are you using?
> > > ÃÂ
> > > I'm using KMotion V4.27
> > > ÃÂ
> > > What exactly do you do to get it to run away?
> > > ÃÂ
> > > Thanks
> > > TK
> > > ÃÂ
> > > ÃÂ
> > > ÃÂ
> > >
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Friday, November 4, 2011 8:34 PM
> > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > >
> > >
> > > ÃÂ
> > > KMotion seems to work OK - no runaway. If I start KMotion, then start Mach3, then jog until the runaway occurs, the motion is reflected in KMotion. If I then do a Disable Axis, Set the Dest for the axis to just beyond where it is, then EnableAxis, it starts right up again. If I first kill Mach3, then it does not start again no the EnableAxis, so it appears Mach3 is somehow commanding to move to somewhere on another planet.
> > >
> > > I'm stumped. I'll post my init and XML in the Files area, as RayLsFiles.zip.
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > >
> > > > Tom,
> > > >
> > > > Well, here's something that should have you scratching your head - I get ALL Of these behaviors with the KFlop plugged into my laptop - no machine, no nothing. It's as bare-bones as I can get. And, when Mach3 E-Stops (which is does EVERY time I jog Y, so this is NOT a noise problem, unless the noise is coming from the KFlop itself!), when I take it out of E-Stop, all the Mach3 DROS get cleared to zeroes! Something is REALLY broken here!
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > > ÃâÃÂ
> > > > > That is strange.ÃâàThe only thing that comes to mind is maybe a huge jog step distance or maybe a really low acceleration setting that would take a long time to decelerate.
> > > > > ÃâÃÂ
> > > > > Can you give more clues like how often it happens, whether it does it when jogging cont. or steps?ÃâàHow is the runaway motion constant speed?ÃâàYour system is open loop so you should be able to test with motor power off and just looking at the DROs and the KMotion Axis screen.
> > > > > ÃâÃÂ
> > > > > If you send me your Init.c and Mach3 XML I can see if I can duplicate it.
> > > > > ÃâÃÂ
> > > > > Thanks
> > > > > TK
> > > > > ÃâÃÂ
> > > > > ÃâÃÂ
> > > > > ÃâÃÂ
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: himykabibble <jagboy@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 3, 2011 7:54 PM
> > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > >
> > > > >
> > > > > ÃâÃÂ
> > > > > Tom,
> > > > >
> > > > > Jogging with the keyboard, no Modbus, no PoKeys. I've only connected the motors, external E-Stop switch, and Z axis limits. E-Stop and Z limits are connected, but disabled.
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi Ray,
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > You are correct there isn't any loop.ÃÆ'ââ¬Å¡ÃâàI headed off in the totally wrong direction.
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > I don't know what it could be.ÃÆ'ââ¬Å¡ÃâàHow were you jogging then anyway?ÃÆ'ââ¬Å¡ÃâàWith the keyboard?ÃÆ'ââ¬Å¡ÃâàDidn't you say you had a modbus MPG?ÃÆ'ââ¬Å¡ÃâàPoKeys?ÃÆ'ââ¬Å¡ÃâàDo you have any external events defined in Mach3?
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > > From: himykabibble <jagboy@>
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, November 3, 2011 6:58 PM
> > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > >
> > > > > >
> > > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > Tom,
> > > > > >
> > > > > > No, my init.c only initializes the axes, and a handful of I/Os, none of which are connected at present. Here's what I've got:
> > > > > >
> > > > > > #include "KMotionDef.h"
> > > > > > #include "MyCommonDefs.h"
> > > > > >
> > > > > > main()
> > > > > > {
> > > > > > ch0->InputMode=NO_INPUT_MODE;
> > > > > > ch0->OutputMode=STEP_DIR_MODE;
> > > > > > ch0->Vel=70000;
> > > > > > ch0->Accel=500000;
> > > > > > ch0->Jerk=4e+006;
> > > > > > ch0->P=0;
> > > > > > ch0->I=0.01;
> > > > > > ch0->D=0;
> > > > > > ch0->FFAccel=0;
> > > > > > ch0->FFVel=0;
> > > > > > ch0->MaxI=200;
> > > > > > ch0->MaxErr=1e+006;
> > > > > > ch0->MaxOutput=200;
> > > > > > ch0->DeadBandGain=1;
> > > > > > ch0->DeadBandRange=0;
> > > > > > ch0->InputChan0=0;
> > > > > > ch0->InputChan1=0;
> > > > > > ch0->OutputChan0=8;
> > > > > > ch0->OutputChan1=0;
> > > > > > ch0->MasterAxis=-1;
> > > > > > ch0->LimitSwitchOptions=0x0;
> > > > > > ch0->InputGain0=1;
> > > > > > ch0->InputGain1=1;
> > > > > > ch0->InputOffset0=0;
> > > > > > ch0->InputOffset1=0;
> > > > > > ch0->OutputGain=1;
> > > > > > ch0->OutputOffset=0;
> > > > > > ch0->SlaveGain=1;
> > > > > > ch0->BacklashMode=BACKLASH_OFF;
> > > > > > ch0->BacklashAmount=0;
> > > > > > ch0->BacklashRate=0;
> > > > > > ch0->invDistPerCycle=1;
> > > > > > ch0->Lead=0;
> > > > > > ch0->MaxFollowingError=1000000000;
> > > > > > ch0->StepperAmplitude=20;
> > > > > >
> > > > > > ch0->iir[0].B0=1;
> > > > > > ch0->iir[0].B1=0;
> > > > > > ch0->iir[0].B2=0;
> > > > > > ch0->iir[0].A1=0;
> > > > > > ch0->iir[0].A2=0;
> > > > > >
> > > > > > ch0->iir[1].B0=1;
> > > > > > ch0->iir[1].B1=0;
> > > > > > ch0->iir[1].B2=0;
> > > > > > ch0->iir[1].A1=0;
> > > > > > ch0->iir[1].A2=0;
> > > > > >
> > > > > > ch0->iir[2].B0=0.000769;
> > > > > > ch0->iir[2].B1=0.001538;
> > > > > > ch0->iir[2].B2=0.000769;
> > > > > > ch0->iir[2].A1=1.92081;
> > > > > > ch0->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(0,0);
> > > > > >
> > > > > > ch1->InputMode=NO_INPUT_MODE;
> > > > > > ch1->OutputMode=STEP_DIR_MODE;
> > > > > > ch1->Vel=70000;
> > > > > > ch1->Accel=500000;
> > > > > > ch1->Jerk=4e+006;
> > > > > > ch1->P=0;
> > > > > > ch1->I=0.01;
> > > > > > ch1->D=0;
> > > > > > ch1->FFAccel=0;
> > > > > > ch1->FFVel=0;
> > > > > > ch1->MaxI=200;
> > > > > > ch1->MaxErr=1e+006;
> > > > > > ch1->MaxOutput=200;
> > > > > > ch1->DeadBandGain=1;
> > > > > > ch1->DeadBandRange=0;
> > > > > > ch1->InputChan0=1;
> > > > > > ch1->InputChan1=0;
> > > > > > ch1->OutputChan0=9;
> > > > > > ch1->OutputChan1=0;
> > > > > > ch1->MasterAxis=-1;
> > > > > > ch1->LimitSwitchOptions=0x0;
> > > > > > ch1->InputGain0=1;
> > > > > > ch1->InputGain1=1;
> > > > > > ch1->InputOffset0=0;
> > > > > > ch1->InputOffset1=0;
> > > > > > ch1->OutputGain=1;
> > > > > > ch1->OutputOffset=0;
> > > > > > ch1->SlaveGain=1;
> > > > > > ch1->BacklashMode=BACKLASH_OFF;
> > > > > > ch1->BacklashAmount=0;
> > > > > > ch1->BacklashRate=0;
> > > > > > ch1->invDistPerCycle=1;
> > > > > > ch1->Lead=0;
> > > > > > ch1->MaxFollowingError=1000000000;
> > > > > > ch1->StepperAmplitude=20;
> > > > > >
> > > > > > ch1->iir[0].B0=1;
> > > > > > ch1->iir[0].B1=0;
> > > > > > ch1->iir[0].B2=0;
> > > > > > ch1->iir[0].A1=0;
> > > > > > ch1->iir[0].A2=0;
> > > > > >
> > > > > > ch1->iir[1].B0=1;
> > > > > > ch1->iir[1].B1=0;
> > > > > > ch1->iir[1].B2=0;
> > > > > > ch1->iir[1].A1=0;
> > > > > > ch1->iir[1].A2=0;
> > > > > >
> > > > > > ch1->iir[2].B0=0.000769;
> > > > > > ch1->iir[2].B1=0.001538;
> > > > > > ch1->iir[2].B2=0.000769;
> > > > > > ch1->iir[2].A1=1.92081;
> > > > > > ch1->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(1,0);
> > > > > >
> > > > > > ch2->InputMode=NO_INPUT_MODE;
> > > > > > ch2->OutputMode=STEP_DIR_MODE;
> > > > > > ch2->Vel=51000;
> > > > > > ch2->Accel=700000;
> > > > > > ch2->Jerk=4e+006;
> > > > > > ch2->P=0;
> > > > > > ch2->I=0.01;
> > > > > > ch2->D=0;
> > > > > > ch2->FFAccel=0;
> > > > > > ch2->FFVel=0;
> > > > > > ch2->MaxI=200;
> > > > > > ch2->MaxErr=1e+006;
> > > > > > ch2->MaxOutput=200;
> > > > > > ch2->DeadBandGain=1;
> > > > > > ch2->DeadBandRange=0;
> > > > > > ch2->InputChan0=2;
> > > > > > ch2->InputChan1=0;
> > > > > > ch2->OutputChan0=10;
> > > > > > ch2->OutputChan1=0;
> > > > > > ch2->MasterAxis=-1;
> > > > > > ch2->LimitSwitchOptions=0x0;
> > > > > > ch2->InputGain0=1;
> > > > > > ch2->InputGain1=1;
> > > > > > ch2->InputOffset0=0;
> > > > > > ch2->InputOffset1=0;
> > > > > > ch2->OutputGain=1;
> > > > > > ch2->OutputOffset=0;
> > > > > > ch2->SlaveGain=1;
> > > > > > ch2->BacklashMode=BACKLASH_OFF;
> > > > > > ch2->BacklashAmount=0;
> > > > > > ch2->BacklashRate=0;
> > > > > > ch2->invDistPerCycle=1;
> > > > > > ch2->Lead=0;
> > > > > > ch2->MaxFollowingError=1000000000;
> > > > > > ch2->StepperAmplitude=20;
> > > > > >
> > > > > > ch2->iir[0].B0=1;
> > > > > > ch2->iir[0].B1=0;
> > > > > > ch2->iir[0].B2=0;
> > > > > > ch2->iir[0].A1=0;
> > > > > > ch2->iir[0].A2=0;
> > > > > >
> > > > > > ch2->iir[1].B0=1;
> > > > > > ch2->iir[1].B1=0;
> > > > > > ch2->iir[1].B2=0;
> > > > > > ch2->iir[1].A1=0;
> > > > > > ch2->iir[1].A2=0;
> > > > > >
> > > > > > ch2->iir[2].B0=0.000769;
> > > > > > ch2->iir[2].B1=0.001538;
> > > > > > ch2->iir[2].B2=0.000769;
> > > > > > ch2->iir[2].A1=1.92081;
> > > > > > ch2->iir[2].A2=-0.923885;
> > > > > >
> > > > > > EnableAxisDest(2,0);
> > > > > >
> > > > > > ch3->InputMode=NO_INPUT_MODE;
> > > > > > ch3->OutputMode=STEP_DIR_MODE;
> > > > > > ch3->Vel=80000;
> > > > > > ch3->Accel=40000;
> > > > > > ch3->Jerk=400000;
> > > > > > ch3->P=1;
> > > > > > ch3->I=0;
> > > > > > ch3->D=0;
> > > > > > ch3->FFAccel=0;
> > > > > > ch3->FFVel=0;
> > > > > > ch3->MaxI=200;
> > > > > > ch3->MaxErr=1e+006;
> > > > > > ch3->MaxOutput=200;
> > > > > > ch3->DeadBandGain=1;
> > > > > > ch3->DeadBandRange=0;
> > > > > > ch3->InputChan0=3;
> > > > > > ch3->InputChan1=3;
> > > > > > ch3->OutputChan0=11;
> > > > > > ch3->OutputChan1=7;
> > > > > > ch3->MasterAxis=-1;
> > > > > > ch3->LimitSwitchOptions=0x0;
> > > > > > ch3->InputGain0=1;
> > > > > > ch3->InputGain1=1;
> > > > > > ch3->InputOffset0=0;
> > > > > > ch3->InputOffset1=0;
> > > > > > ch3->OutputGain=1;
> > > > > > ch3->OutputOffset=0;
> > > > > > ch3->SlaveGain=1;
> > > > > > ch3->BacklashMode=BACKLASH_OFF;
> > > > > > ch3->BacklashAmount=0;
> > > > > > ch3->BacklashRate=0;
> > > > > > ch3->invDistPerCycle=1;
> > > > > > ch3->Lead=0;
> > > > > > ch3->MaxFollowingError=1000000000;
> > > > > > ch3->StepperAmplitude=20;
> > > > > >
> > > > > > ch3->iir[0].B0=1;
> > > > > > ch3->iir[0].B1=0;
> > > > > > ch3->iir[0].B2=0;
> > > > > > ch3->iir[0].A1=0;
> > > > > > ch3->iir[0].A2=0;
> > > > > >
> > > > > > ch3->iir[1].B0=1;
> > > > > > ch3->iir[1].B1=0;
> > > > > > ch3->iir[1].B2=0;
> > > > > > ch3->iir[1].A1=0;
> > > > > > ch3->iir[1].A2=0;
> > > > > >
> > > > > > ch3->iir[2].B0=1;
> > > > > > ch3->iir[2].B1=0;
> > > > > > ch3->iir[2].B2=0;
> > > > > > ch3->iir[2].A1=0;
> > > > > > ch3->iir[2].A2=0;
> > > > > >
> > > > > > EnableAxisDest(3,0);
> > > > > >
> > > > > > DefineCoordSystem(0,1,2,3);
> > > > > >
> > > > > > // Configure Enable bit as output, and clear it
> > > > > > SetBitDirection(ENABLE, 1);
> > > > > > //ClearBit(ENABLE);
> > > > > >
> > > > > > // Configure Spindle Control pins as outputs, and clear them
> > > > > > SetBitDirection(SPINDLE_CW, 1);
> > > > > > ClearBit(SPINDLE_CW);
> > > > > > SetBitDirection(SPINDLE_CCW, 1);
> > > > > > ClearBit(SPINDLE_CCW);
> > > > > > // Zero the spindle PWM output
> > > > > > FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
> > > > > > FPGA(IO_PWMS) = (unsigned char)(0); // set period
> > > > > > FPGA(IO_PWMS+1) = 1; // Enable
> > > > > >
> > > > > > // Configure Coolant Control pins as outputs, and clear them
> > > > > > SetBitDirection(COOLANT_MIST, 1);
> > > > > > ClearBit(COOLANT_MIST);
> > > > > > SetBitDirection(COOLANT_FLOOD, 1);
> > > > > > ClearBit(COOLANT_FLOOD);
> > > > > >
> > > > > > // Configure Probe pin as input
> > > > > > SetBitDirection(PROBE, 0);
> > > > > >
> > > > > > // Configire E-Stop pin as input
> > > > > > SetBitDirection(ESTOP, 0);
> > > > > >
> > > > > > // Configure Home/Limit pin as input
> > > > > > SetBitDirection(HOME_LIMIT, 0);
> > > > > >
> > > > > > }
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > >
> > > > > > > Hi Ray,
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Only the programs that have been told to execute will be running.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàI assumed you created and configured an Init.c program with the MPG code.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat is a reqirement before you even try to run Mach3.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàOften a loop is placed at the end of the Init.c program to run forever after everything is initialized.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe loop can do things like service the MPG and also perform watchdog type tasks.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Maybe you could postÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡Ãâàthe Init.c file you areÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡Ãâàconfigured to use.
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Regards
> > > > > > > TK
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > >
> > > > > > > From: himykabibble <jagboy@>
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, November 3, 2011 5:54 PM
> > > > > > > Subject: [DynoMotion] Re: Uh-Oh! Runaway Jogging!
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > Tom,
> > > > > > >
> > > > > > > I didn't know it was running an MPG program.... How do I know which of the bazillions of programs in the CPrograms directory are actually running?
> > > > > > >
> > > > > > > Also, I had a line in my init.c to clear the enable for the servo power supplies, so I would have to explicitly enable them before anything came "live". But, with this line in the init.c I *can't* turn on the enable through the command window. Whats the catch? Does the init.c get run more than just at startup?
> > > > > > >
> > > > > > > Regards,
> > > > > > > Ray L.
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > > > >
> > > > > > > > Hi Ray,
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Sounds like you have noise problems.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàKFLOP inputs are high impedance and fast.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Regarding the "runaway":ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is probably noise causing the MPG program to get confused.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIt is somewhat complicated to explain, but the example MPG program (Init3AnalogPlusMPG.c) uses software to monitor the MPG and a "trick" to extend the count rate.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe MPG program loops at about 5KHz.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàWithout the "trick" the count rate is then limited to 5KHz.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThat would be ~750 RPM for a 100 ppr
> encoder.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe "trick" uses the assumption that the encoder speed can't change significantly instantaneously (< 1 millisec).ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàSo it uses the previous velocity to predict where the encoder is likely to be (expecting to skip counts) and the
> > > encoder signals tell whether the prediction was correct or off by either +1 or -1 count.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis can extend the counting rate to as high as
> > > > > 100KHz.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThis works exceptionally well in the absence of noise.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàNoise can generate signal sequences
> > > > > > that basically make no physical sense which confuse the
> > > > > > > algorithm and causes a runaway
> > > > > > > > (It assumes the signals are aliasing at a high speed).
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > >
> > > > > > > >
> > > > > > > > From: himykabibble <jagboy@>
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Sent: Thursday, November 3, 2011 4:34 PM
> > > > > > > > Subject: [DynoMotion] Uh-Oh! Runaway Jogging!
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > I have only the four axes connected to my machine at present, and it seems to work fine, except.... fairly often, when I jog, the axis will just take off and keep right on going until I pull the USB cable! I don't *think* I've seen this happen with KMotion, but it happens often with Mach3, and keeps going regardless of hitting E-Stop or even closing Mach3.
> > > > > > > >
> > > > > > > > Where to look?
> > > > > > > >
> > > > > > > > I also have what appears to be a noise problem - I can jog X, Z and A all I want with no problems (other than the above). But, about 50% of the time jogging Y will trigger an E-Stop. This is odd, as I've never, EVER had any noise problems with this machine. This problem doesn't really concern me too much at the moment, however.
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Ray L.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > You can disable the "trick" by changing the line:
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap) + (Change2+Change1);
> > > > > > > > to
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàDiffX2 = 2*(Pos-PosNoWrap);
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Noise will then just cause several miss-steps and no runaway.ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàYou will then be limited to 5KHz encoder rates.
> > > > > > > > Its also possible to use a hardware encoder input but that consumes an encoder input and limits the choices for Pins.
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Please give this a try to see if it stops any runaways.
> > > > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
|
|
| | | | | | | | | | | | | | | |